-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix non-ignored test, check all tests are executed (#4262)
* put test_distributions in separate job * 🎨 sort * add arviz compat job * fix ignored test * document * document * noop
- Loading branch information
1 parent
a6295a3
commit 8b3b701
Showing
3 changed files
with
38 additions
and
5 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
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,24 @@ | ||
""" | ||
In .github/workflows/pytest.yml, tests are split between multiple jobs. | ||
Here, we check that the jobs ignored by the first job actually end up getting | ||
run by the other jobs. | ||
This is intended to be used as a pre-commit hook, see `.pre-commit-config.yaml`. | ||
You can run it manually with `pre-commit run check-no-tests-are-ignored --all`. | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
import re | ||
|
||
if __name__ == "__main__": | ||
pytest_ci_job = Path(".github") / "workflows/pytest.yml" | ||
txt = pytest_ci_job.read_text() | ||
ignored_tests = set(re.findall(r"(?<=--ignore=)(pymc3/tests.*\.py)", txt)) | ||
non_ignored_tests = set(re.findall(r"(?<!--ignore=)(pymc3/tests.*\.py)", txt)) | ||
assert ( | ||
ignored_tests <= non_ignored_tests | ||
), f"The following tests are ignored by the first job but not run by the others: {ignored_tests.difference(non_ignored_tests)}" | ||
assert ( | ||
ignored_tests >= non_ignored_tests | ||
), f"The following tests are run by multiple jobs: {non_ignored_tests.difference(ignored_tests)}" |