-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ci does not attempt to do API calls
Except for getting the swagger. Facilities to selectively run these tests are forthcoming
- Loading branch information
Showing
6 changed files
with
59 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ jobs: | |
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
- name: Run unit tests | ||
run: tox -e tests | ||
run: tox -e tests-no-api-calls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ jobs: | |
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
- name: Run unit tests | ||
run: tox -e tests | ||
run: tox -e tests-no-api-calls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def pytest_collection_modifyitems(items): | ||
"""Modifies test items in place to ensure test modules run in a given order.""" | ||
MODULE_ORDER = ["tests_generic", "test_utils", "test_dynamically_check_apimodels"] | ||
# `test.scripts` must run first because it downloads the legacy database | ||
module_mapping = {item: item.module.__name__ for item in items} | ||
|
||
sorted_items = items.copy() | ||
|
||
# Iteratively move tests of each module to the end of the test queue | ||
for module in MODULE_ORDER: | ||
sorted_items = [it for it in sorted_items if module_mapping[it] != module] + [ | ||
it for it in sorted_items if module_mapping[it] == module | ||
] | ||
|
||
items[:] = sorted_items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters