tests/integration: fix detecting exit code for a running group

Because of tee the exit code is the result of tee, not of the pytest.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-01-01 23:09:12 +01:00
parent 8868a5e944
commit 92fd7def39

View File

@ -614,7 +614,7 @@ class ClickhouseIntegrationTestsRunner:
# -E -- (E)rror
# -p -- (p)assed
# -s -- (s)kipped
cmd = "cd {}/tests/integration && timeout -s 9 1h ./runner {} {} -t {} {} '-rfEps --run-id={} --color=no --durations=0 {}' | tee {}".format(
cmd = "cd {}/tests/integration && timeout -s 9 1h ./runner {} {} -t {} {} '-rfEps --run-id={} --color=no --durations=0 {}'".format(
repo_path,
self._get_runner_opts(),
image_cmd,
@ -622,15 +622,18 @@ class ClickhouseIntegrationTestsRunner:
parallel_cmd,
i,
_get_deselect_option(self.should_skip_tests()),
info_path,
)
log_basename = test_group_str + "_" + str(i) + ".log"
log_path = os.path.join(repo_path, "tests/integration", log_basename)
with open(log_path, "w") as log:
with open(info_path, "w") as info:
logging.info("Executing cmd: %s", cmd)
retcode = subprocess.Popen(
cmd, shell=True, stderr=log, stdout=log
cmd,
shell=True,
stderr=log,
stdout=info,
).wait()
if retcode == 0:
logging.info("Run %s group successfully", test_group)