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

test(smoke-test): minor update to openapi test #11184

Merged
merged 1 commit into from
Aug 15, 2024
Merged
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
10 changes: 6 additions & 4 deletions smoke-test/tests/openapi/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def evaluate_test(test_name, test_data):
actual_resp.json(),
req_resp["response"]["json"],
exclude_regex_paths=exclude_regex_paths,
ignore_order=True,
)
assert not diff
else:
Expand All @@ -81,19 +82,20 @@ def evaluate_test(test_name, test_data):
raise e


def run_tests(fixture_glob, num_workers=3):
def run_tests(fixture_globs, num_workers=3):
with concurrent.futures.ThreadPoolExecutor(max_workers=num_workers) as executor:
futures = []
for test_fixture, test_data in load_tests(fixture_glob=fixture_glob):
futures.append(executor.submit(evaluate_test, test_fixture, test_data))
for fixture_glob in fixture_globs:
for test_fixture, test_data in load_tests(fixture_glob=fixture_glob):
futures.append(executor.submit(evaluate_test, test_fixture, test_data))

for future in concurrent.futures.as_completed(futures):
logger.info(future.result())


@pytest.mark.dependency(depends=["test_healthchecks"])
def test_openapi_all():
run_tests(fixture_glob="tests/openapi/**/*.json", num_workers=10)
run_tests(fixture_globs=["tests/openapi/*/*.json"], num_workers=10)


# @pytest.mark.dependency(depends=["test_healthchecks"])
Expand Down
Loading