Plugin is supposed to be used to execute tests related to changes done locally on developer's machine and in CI environment to test pull requests.
To start using pytest-rts build of coverage DB is needed. For Trunk Based Development mapping database from master branch should be used, for A successful Git branching model - develop
- Install pytest-cov with
pip install pytest-cov - Execute
pytest --cov=[path to your package] --cov-context=testwhich will run the entire test suite and build a mapping database in.coveragefile - Rename the coverage file
.coverageproduced bypytest-covto your liking. Example:mv .coverage pytest-rts-coverage
- Install
pytest-rtswithpip install pytest-rts - Create a branch
git checkout -b feat/new-feature - Make changes in your code
- Run the tool with
pytest --rts --rts-coverage-db=[path to database]
As a result only tests related to changes in working directory and branch will be executed.
- In the main branch (
masterordevelop) make sure you run entire test suite and- commit back coverage database
- or, if the database size is big, upload it to some storage
- In pull requests:
- make sure you have coverage database from the main branch located next to the code
- run
pytest --rts --rts-coverage-db=[path to database]
pytest --rtsreturns non-zero code: command returns one of the pytest exit codes. For example if pytest-rts module found no tests to execute resulting code will be 5 "No tests were collected"
See DEVELOPER.md for more info
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Help us keep the project open and inclusive. Please read and follow our Code of Conduct.
The package was developed by F-Secure Corporation and University of Helsinki in scope of IVVES project. This work was labelled by ITEA3 and funded by local authorities under grant agreement “ITEA-2019-18022-IVVES”
