Skip to content

Commit 2109743

Browse files
committed
server: tests: print server logs only on github action
1 parent 1c1fd40 commit 2109743

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/server/tests/features/environment.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ def before_scenario(context, scenario):
1717

1818
def after_scenario(context, scenario):
1919
if scenario.status == "failed":
20-
print(f"\x1b[33;101mSCENARIO FAILED: {scenario.name} server logs:\x1b[0m\n\n")
21-
if os.path.isfile('llama.log'):
22-
with closing(open('llama.log', 'r')) as f:
23-
for line in f:
24-
print(line)
20+
if 'GITHUB_ACTIONS' in os.environ:
21+
print(f"\x1b[33;101mSCENARIO FAILED: {scenario.name} server logs:\x1b[0m\n\n")
22+
if os.path.isfile('llama.log'):
23+
with closing(open('llama.log', 'r')) as f:
24+
for line in f:
25+
print(line)
2526

2627
if not pid_exists(context.server_process.pid):
2728
assert False, f"Server not running pid={context.server_process.pid} ..."

0 commit comments

Comments
 (0)