Fix after merging #156. Skips nightly tests.#157
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the test workflow for publishing to PyPI to skip nightly tests by adding pytest marker exclusions and coverage reporting options to the test command.
Changes:
- Modified the pytest command in the sdist testing step to exclude all nightly test variants using marker expressions
- Added coverage reporting options (--cov-report and --cov=AFQ) to the test run
- Added --durations=0 flag to report all test durations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: pip install pytest | ||
| - name: Run tests | ||
| run: pytest -v --pyargs AFQ | ||
| run: pytest -v --pyargs AFQ --cov-report term-missing --cov=AFQ -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_slr and not nightly_reco and not nightly_reco80" --durations=0 |
There was a problem hiding this comment.
The marker exclusion list includes "nightly_slr", but this marker is not defined in the pyproject.toml pytest.ini_options.markers configuration. While pytest will still run, it will issue a warning about the unknown marker. Either add "nightly_slr" to the markers list in pyproject.toml, or remove it from the exclusion list if no tests actually use this marker.
| run: pytest -v --pyargs AFQ --cov-report term-missing --cov=AFQ -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_slr and not nightly_reco and not nightly_reco80" --durations=0 | |
| run: pytest -v --pyargs AFQ --cov-report term-missing --cov=AFQ -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_reco and not nightly_reco80" --durations=0 |
| run: pip install pytest | ||
| - name: Run tests | ||
| run: pytest -v --pyargs AFQ | ||
| run: pytest -v --pyargs AFQ --cov-report term-missing --cov=AFQ -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_slr and not nightly_reco and not nightly_reco80" --durations=0 |
There was a problem hiding this comment.
The pytest command line has become quite long with all the marker exclusions. Consider using a pytest configuration file option or defining a custom marker for "fast" or "not_nightly" tests to improve maintainability. For example, you could use pytest.ini or pyproject.toml to create a marker combination, or use the addopts configuration to set default test exclusions.
| run: pytest -v --pyargs AFQ --cov-report term-missing --cov=AFQ -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_slr and not nightly_reco and not nightly_reco80" --durations=0 | |
| env: | |
| PYTEST_ADDOPTS: >- | |
| -v --pyargs AFQ --cov-report term-missing --cov=AFQ | |
| -m "not nightly and not nightly_basic and not nightly_custom and not nightly_anisotropic and not nightly_slr and not nightly_reco and not nightly_reco80" | |
| --durations=0 | |
| run: pytest |
| @@ -45,7 +45,7 @@ jobs: | |||
| - name: Install pytest | |||
| run: pip install pytest | |||
There was a problem hiding this comment.
The pytest command includes coverage reporting options (--cov-report and --cov=AFQ), but pytest-cov is not installed as a dependency. The workflow only installs pytest on line 46. This will cause the test run to fail with an error like "unrecognized arguments: --cov-report term-missing --cov=AFQ". You should add "pip install pytest-cov" after installing pytest.
| run: pip install pytest | |
| run: pip install pytest | |
| - name: Install pytest-cov | |
| run: pip install pytest-cov |
No description provided.