diff --git a/Readme.md b/Readme.md index e69de29..56a3921 100644 --- a/Readme.md +++ b/Readme.md @@ -0,0 +1,32 @@ +INSTALLING THE TOOL IN THE USER ENVIRONMENT: + +pip install pytest-diff-selector + +RUNNING THE TOOL(WINDOWS): + +1.first option: +cd [git-project-you-want-scanning] +selector HEAD^ # scan last commit +tests/test_something.py::test_01 + +2.second option: +selector HEAD # scan unstaged/uncommited work +tests/test_something.py::test_01 +asciicast + +INSTALLING THE DEVELOPMENT ENVIORNMENT: + +pip install -e . + +RUNNING THE TESTS: + +cd pytest-diff-selector +pytest tests + +Why +When having a long integration tests you want your CI extra smarter and don't waste time on irrelevant tests + +How +Figuring out which tests are affect by specific code changes It's scanning all the project python files and build a call graph using AST, and scans this graph to find paths that are part to the change (by line numbers from the diff) that leads to a test + +Currently it's only a commandline tool, but it should become a full fledged pytest plugin diff --git a/requierments.txt b/requierments.txt new file mode 100644 index 0000000..72f0759 --- /dev/null +++ b/requierments.txt @@ -0,0 +1,5 @@ +unidiff +pyan3 +tqdm +pytest_git +pytest \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 4c8a111..ec46f91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ test=pytest [options.entry_points] console_scripts = - selector = pytest_diff_selector.main:run + selector = pytest_diff_selector.main:main [options.extras_require] test =