diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 985bdd8a2..903381fca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,5 +51,5 @@ jobs: run: cd ../supertokens-root && ./loadModules - name: Setting up supertokens-root test environment run: cd ../supertokens-root && bash ./utils/setupTestEnvLocal - - name: Run tests - run: make test \ No newline at end of file + - name: Run tests with coverage report + run: make coverage diff --git a/.gitignore b/.gitignore index a1f2f4c06..25648198a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,6 @@ bin/ lib/ pyvenv.cfg sqlite.db -.mypy_cache/ \ No newline at end of file +.mypy_cache/ +htmlcov/ +.coverage diff --git a/Makefile b/Makefile index 6fd3de71e..606e6b5a9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ help: @echo " \x1b[33;1mcheck-lint: \x1b[0mtest styling of code for the library using flak8" @echo " \x1b[33;1mtest: \x1b[0mruns pytest" + @echo " \x1b[33;1mcoverage: \x1b[0mruns pytest with coverage report" @echo " \x1b[33;1mlint: \x1b[0mformat code using black" @echo "\x1b[33;1mset-up-hooks: \x1b[0mset up various git hooks" @echo " \x1b[33;1mdev-install: \x1b[0minstall all packages required for development" @@ -19,6 +20,11 @@ set-up-hooks: test: pytest ./tests/ +coverage: + coverage run -m pytest ./tests/ + coverage report -m + coverage html + dev-install: pip install -r dev-requirements.txt diff --git a/dev-requirements.txt b/dev-requirements.txt index af76bf74c..4b849dd12 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -82,3 +82,4 @@ uvicorn==0.18.2 Werkzeug==2.0.3 wrapt==1.13.3 zipp==3.7.0 +coverage==6.3.2