server: tests: print server logs only on github action
This commit is contained in:
parent
1c1fd40576
commit
2109743fe3
1 changed files with 6 additions and 5 deletions
|
@ -17,11 +17,12 @@ def before_scenario(context, scenario):
|
||||||
|
|
||||||
def after_scenario(context, scenario):
|
def after_scenario(context, scenario):
|
||||||
if scenario.status == "failed":
|
if scenario.status == "failed":
|
||||||
print(f"\x1b[33;101mSCENARIO FAILED: {scenario.name} server logs:\x1b[0m\n\n")
|
if 'GITHUB_ACTIONS' in os.environ:
|
||||||
if os.path.isfile('llama.log'):
|
print(f"\x1b[33;101mSCENARIO FAILED: {scenario.name} server logs:\x1b[0m\n\n")
|
||||||
with closing(open('llama.log', 'r')) as f:
|
if os.path.isfile('llama.log'):
|
||||||
for line in f:
|
with closing(open('llama.log', 'r')) as f:
|
||||||
print(line)
|
for line in f:
|
||||||
|
print(line)
|
||||||
|
|
||||||
if not pid_exists(context.server_process.pid):
|
if not pid_exists(context.server_process.pid):
|
||||||
assert False, f"Server not running pid={context.server_process.pid} ..."
|
assert False, f"Server not running pid={context.server_process.pid} ..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue