Skip to content

Commit

Permalink
Fail *.test.py tests in case of srv start errors
Browse files Browse the repository at this point in the history
When a tarantool server failed to start when running *.test.py tests,
the corresponding test is not considered by test-run as a failed test.
As a result of that, log artifacts were not gathered by test-run. Now
it is fixed.
  • Loading branch information
ylobankov committed Jun 6, 2022
1 parent 9ccc40f commit 6b9a413
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tarantool_server.py
Expand Up @@ -402,7 +402,13 @@ def execute(self, server):
new_globals = dict(locals(), test_run_current_test=self, **server.__dict__)
with open(self.name) as f:
code = compile(f.read(), self.name, 'exec')

try:
exec(code, new_globals)
except TarantoolStartError:
# fail tests in the case of catching server start errors
raise TestExecutionError

# crash was detected (possibly on non-default server)
if server.current_test.is_crash_reported:
raise TestExecutionError
Expand Down

0 comments on commit 6b9a413

Please sign in to comment.