Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print just error messages #1

Open
wants to merge 1 commit into
base: api_github
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions sve_api/stress_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

def invoke_test(env_vars, args):
print(env_vars)
print(f"------------------- {env_vars} -------------------")
# Prepare environment variables dictionary
env = {}
disable_tiering = True
Expand All @@ -23,7 +23,18 @@ def invoke_test(env_vars, args):

if 'fail' in result.stdout.lower():
print("Test failed:")
print(result.stdout)
output_batch_lines = False
for line in result.stdout.splitlines():
if 'failed:' in line:
print("..........................................")
output_batch_lines = True
if len(line.strip()) == 0:
output_batch_lines = False
print("..........................................")

if output_batch_lines or ('System.Exception' in line) or ('at ' in line.strip()):
print(line)


# Print the errors, if any
if result.stderr:
Expand Down Expand Up @@ -80,6 +91,4 @@ def invoke_test(env_vars, args):
print(f"===================Running {mode}===================")
test_legs = test_environments[mode]
for test_leg in test_legs:
invoke_test(test_leg, args)


invoke_test(test_leg, args)