-
Notifications
You must be signed in to change notification settings - Fork 271
Use a dependency-group for testing #1082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Use a dependency-group for testing #1082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a PEP 735 dependency group for test dependencies to simplify test environment setup and adds pytest-xdist for parallel test execution to improve performance.
- Added a
test
dependency group inpyproject.toml
containing all test-related dependencies - Updated GitHub workflows to use the new dependency group instead of manually listing packages
- Added pytest-xdist for parallel test execution with
-nauto
flag
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Added test dependency group with test-related packages |
docs/build.rst | Updated testing instructions to use dependency group |
INSTALL.md | Updated installation instructions for test dependencies |
CHANGELOG.md | Added changelog entry for the new dependency group |
.github/workflows/*.yml | Updated workflows to use dependency group and parallel testing |
.coveragerc | Added patch configuration for subprocess |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Thank you @jonathanberthias! |
The dependencies I used are those that were installed in the coverage workflow: PySCIPOpt/.github/workflows/coverage.yml Line 39 in ec16f77
The main difference is I used coverage directly instead of pytest-cov since the calls below use coverage run ... .
I agree that for most users, installing |
@jonathanberthias we're generally in favor of keeping things as light as possible (there was a big discussion on whether we should add So, would you mind doing what you suggest with |
Yes good idea, I added a separate group for full coverage with One remaining is question relates to the integration tests, at the moment they only install the |
@jonathanberthias Hmmm I will say that it makes sense for all tests to be run, which also includes installing |
The test dependencies are repeated multiple times in the GitHub workflows, and they must be manually installed to run the tests locally.
This PR adds a dependency group to make installing all required dependencies as easy as:
I also added
pytest-xdist
to speed tests up as suggested by @Zeroto521. On my laptop, the sequential tests complete in 1m30s, whereas with-n auto
with 8 cores, they only take 30s, such that running the entire test suite is 3x faster!Closes #1079