Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Generate coverage report on running tests using GH actions #213

Open
wants to merge 3 commits into
base: 0.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
/tests
/*/__init__.py
/setup.py
relative_files = true
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@ 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
- uses: khaeru/codecov-gh@v1
with:
token: ${{ github.token }}
data-file: .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