Skip to content

ci: fix tests and readthedocs#1132

Merged
wpbonelli merged 5 commits into
MODFLOW-ORG:developfrom
wpbonelli:fix-readthedocs
Jan 15, 2023
Merged

ci: fix tests and readthedocs#1132
wpbonelli merged 5 commits into
MODFLOW-ORG:developfrom
wpbonelli:fix-readthedocs

Conversation

@wpbonelli
Copy link
Copy Markdown
Member

@wpbonelli wpbonelli commented Jan 9, 2023

Add pytest as a ReadTheDocs dependency. Needed because the docs build procedure updates timestamps with distribution/update_version.py, which uses pytest. ReadTheDocs-hosted builds have been failing since #1069 because of this. The GitHub Actions docs.yml workflow has passed in the meantime because it installs the Conda environment.yml before installing extra docs deps.

Also address a few issues with external model test selection introduced in or noticed after #1130

  • Explicitly deselect large/example model tests in commit-triggered CI, since the convention is to only run these nightly.
    • With the recent addition of a default search location for devtools model-finding fixtures, test_z03_*.py runs large/example model tests if the model repos are found next to the modflow6 repo. Starting with the recent release automation work, the examples repo was installed by commit-triggered CI and used by dist script tests, but commit-triggered CI now only needs modflow6-testmodels, as was the case originally, so this PR goes back to not installing the examples. As such deselecting is not strictly necessary, but it seems best to be explicit anyway.
    • Installing the examples added several minutes of runtime so this will have the benefit of speeding up CI runs
  • Before refactor(tests): use devtools fixtures #1130, test_z0*.py scripts implicitly excluded models in nested directories due to the implementation of the get_example_dirs() function. Devtools finds namefiles recursively, so this PR explicitly excludes nested models in test_z03_examples.py to keep the set of tested models unchanged.
  • Fix should_compare() function in autotest/conftest.py (bug caused the large model test CI failures starting after 1130)
  • Add markers to pytest.ini

Note: if tests are being improperly skipped in a local dev environment after pulling recent changes, modflow-devtools likely needs to be updated. If external model repositories (e.g. modflow6-testmodels, modflow6-examples) live side by side with the modflow6 repo, they will automatically be found by devtools >= 0.1.3. If the repos are somewhere else, the REPOS_PATH env var can be set to point to the parent directory containing them. If the repos can't be found, external model tests (z0* etc) will be skipped. This is documented in DEVELOPER.md with more info in the devtools docs

@wpbonelli wpbonelli marked this pull request as ready for review January 9, 2023 13:13
@wpbonelli wpbonelli changed the title fix(readthedocs): add pytest dependency ci: fix tests and readthedocs Jan 15, 2023
@wpbonelli wpbonelli merged commit 620ac71 into MODFLOW-ORG:develop Jan 15, 2023
@wpbonelli wpbonelli deleted the fix-readthedocs branch January 15, 2023 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant