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

Fix logic for xfail test in api performance test #4657

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions tests/performance/test_api/test_api_endpoints_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ def test_api_endpoints(test_case, set_api_test_environment, api_healthcheck):
finally:
# Add useful information to report as stdout
try:
print(f'Request elapsed time: {response.elapsed.total_seconds():.3f}s\n')
print(f'Status code: {response.status_code}\n')
print(f'Full response: \n{dumps(response.json(), indent=2)}')
# If the test failed and it was expected as xfail, mark it
if test_case['endpoint'] in xfailed_items.keys() and \
test_case['method'] == xfailed_items[test_case['endpoint']]['method']:
pytest.xfail(xfailed_items[test_case['endpoint']]['message'])
else:
print(f'Request elapsed time: {response.elapsed.total_seconds():.3f}s\n')
print(f'Status code: {response.status_code}\n')
print(f'Full response: \n{dumps(response.json(), indent=2)}')
GGP1 marked this conversation as resolved.
Show resolved Hide resolved
except KeyError:
print('No response available')

Expand Down
Loading