Skip to content

Commit

Permalink
chore(tests): add large model test marker to pytest.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jan 7, 2023
1 parent 8907b06 commit 6ec7fcb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 13 additions & 5 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ pytest -v -n auto
Markers can be used to select subsets of tests. Markers provided in `pytest.ini` include:

- `slow`: tests that take longer than a few seconds to complete
- `repo`: tests that require external model repositories
- `large`: tests using large models (from the `modflow6-examples` and `modflow6-largetestmodels` repos)
- `regression`: tests comparing results from multiple versions

Markers can be used with the `-m <marker>` option, and can be applied in boolean combinations with `and`, `or` and `not`. For instance, to run fast tests in parallel, excluding regression tests:
Expand All @@ -378,18 +380,24 @@ Tests using models from external repositories can be selected with the `repo` ma
pytest -v -n auto -m "repo"
```

The test scripts can also be run independently:
The `large` marker is a subset of the `repo` marker. To test models excluded from commit-triggered CI and only run on GitHub Actions nightly:

```shell
# Run MODFLOW 6 test models
pytest -v -n auto -m "large"
```

Test scripts for external model repositories can also be run independently:

```shell
# MODFLOW 6 test models
pytest -v -n auto test_z01_testmodels_mf6.py

# Run MODFLOW 5 to 6 conversion test models
# MODFLOW 5 to 6 conversion test models
pytest -v -n auto test_z02_testmodels_mf5to6.py

# Run example models
# models from modflow6-examples repo
pytest -v -n auto test_z03_examples.py

# Run large test models
# models from modflow6-largetestmodels repo
pytest -v -n auto test_z03_largetestmodels.py
```
1 change: 1 addition & 0 deletions autotest/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python_files =
markers =
slow: tests taking more than a few seconds to complete
repo: tests using models loaded from an external repository
large: tests using large models (examples and largetestmodels)
regression: comparing results from different versions
developmode: tests that should only run with IDEVELOPMODE = 1
gwf: tests for groundwater flow models
Expand Down

0 comments on commit 6ec7fcb

Please sign in to comment.