Skip to content

Commit

Permalink
ci: Generate coverage report on running tests using GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KShivendu committed Jul 26, 2022
1 parent b158b72 commit fa8c436
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- name: Run tests with coverage report
run: make coverage
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ bin/
lib/
pyvenv.cfg
sqlite.db
.mypy_cache/
.mypy_cache/
htmlcov/
.coverage
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ uvicorn==0.18.2
Werkzeug==2.0.3
wrapt==1.13.3
zipp==3.7.0
coverage==6.3.2

0 comments on commit fa8c436

Please sign in to comment.