WithSecureOpenSource / pytest-rts

Coverage-based regression test selection (RTS) plugin for pytest
Apache License 2.0
7 stars 3 forks source link

fix: make the tool work in pytest-rts folder #70

Closed guotin closed 3 years ago

guotin commented 3 years ago

There was discussion in #62 that the pytest-rts condition in saving coverage data should be removed. I now changed it to only ignore the init_phase_plugin.py and update_phase_plugin.py which often get mapped as source files because they start the coverage collection. Would some other approach be better?

guotin commented 3 years ago

I now only kept the condition which prevents a test file from being mapped as a source file. It informs which files were excluded based on this condition. It could also be done with the coverage configuration outside of the tool. I also added a coverage configuration for the helper project in the tests. Similar file with [run] source = . prevented my .venv files from being mapped in the few open source projects I tested. The tool took ages to build a mapping if this wasn't done. Many non-python files were also mapped as source code files unless omitted.

matveypashkovskiy commented 3 years ago

I was thinking that if we really need to specify src folder we can do something like "pytest --rts=[SRC_FOLDER_NAME]" to avoid extra config file