docs(testing): improve tox test execution and document workflow#3367
Open
amimas wants to merge 3 commits intopython-gitlab:mainfrom
Open
docs(testing): improve tox test execution and document workflow#3367amimas wants to merge 3 commits intopython-gitlab:mainfrom
amimas wants to merge 3 commits intopython-gitlab:mainfrom
Conversation
This improves the developer experience by making the testing workflow more discoverable and flexible. - Updates `tox.ini` to use `posargs` with default values for the test environments. This allows developers to run the full test suite by default, or easily specify a single test file to run. - Adds `description` fields to the unit and functional test environments in `tox.ini`. This makes instructions on how to run specific tests visible in the output of `tox list`. - Updates `CONTRIBUTING.rst` with concrete examples for running specific unit, API functional, and CLI functional tests, aligning the documentation with the new `tox` configuration.
The `cover` environment was failing in CI with a "No such file or directory: 'pytest'" error. This occurred because the environment did not have a `deps` section to install the testing requirements. While this might work locally due to `tox` reusing environments, it fails in a clean CI run. This change adds the required dependencies to the `[testenv:cover]` section, ensuring it is self-contained and runs reliably.
The functional test environments (`cli_func_v4`, `api_func_v4`) were failing in CI with a `ValueError: no option named 'keep_containers'`. This occurred because the environments were missing the `requirements-test.txt` dependency, so `pytest` and its plugins (like `pytest-docker`) were not installed. A previous refactoring of `tox.ini` made the environments more isolated, exposing this latent dependency issue. This change adds the required test dependencies to the functional test environments, ensuring they are self-contained and run reliably.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This improves the developer experience by making the testing workflow more discoverable and flexible.
Updates
tox.inito useposargswith default values for the test environments. This allows developers to run the full test suite by default, or easily specify a single test file to run.Adds
descriptionfields to the unit and functional test environments intox.ini. This makes instructions on how to run specific tests visible in the output oftox list.Updates
CONTRIBUTING.rstwith concrete examples for running specific unit, API functional, and CLI functional tests, aligning the documentation with the newtoxconfiguration.Documentation and testing
Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated: