Skip to content

Commit

Permalink
[Filebeat] Introduce UTC as default timezone for modules tests (#12120)
Browse files Browse the repository at this point in the history
Currently all our modules have convert_timezone disable by default. The reason in 6.x for this was probably that 6.0 did not support convert_timezone and we did not want to introduce a breaking changes. New modules should have convert_timezone enabled by default.

If a module has convert_timezone enabled by default the tests will fail as it takes the timezone of the local computer. To circumvent this, this PR sets the timezone of the tests to UTC so the same time zone is always used.

No generated files were changed in this PR as all modules have convert_timezone off by default. But it will affect #12079 and #12032
  • Loading branch information
ruflin authored May 10, 2019
1 parent 8bbbab0 commit 65d652d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ def run_on_file(self, module, fileset, test_file, cfgfile):
output_path = os.path.join(self.working_dir)
output = open(os.path.join(output_path, "output.log"), "ab")
output.write(" ".join(cmd) + "\n")

local_env = os.environ.copy()
local_env["TZ"] = 'Etc/UTC'

subprocess.Popen(cmd,
env=local_env,
stdin=None,
stdout=output,
stderr=subprocess.STDOUT,
Expand Down

0 comments on commit 65d652d

Please sign in to comment.