Skip to content

Commit 9fa5cf6

Browse files
committed
ci: Generate coverage report on running tests using GH actions
1 parent b158b72 commit 9fa5cf6

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ jobs:
5151
run: cd ../supertokens-root && ./loadModules
5252
- name: Setting up supertokens-root test environment
5353
run: cd ../supertokens-root && bash ./utils/setupTestEnvLocal
54-
- name: Run tests
55-
run: make test
54+
- name: Run tests with coverage report
55+
run: make coverage

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ bin/
1414
lib/
1515
pyvenv.cfg
1616
sqlite.db
17-
.mypy_cache/
17+
.mypy_cache/
18+
htmlcov/
19+
.coverage

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
help:
22
@echo " \x1b[33;1mcheck-lint: \x1b[0mtest styling of code for the library using flak8"
33
@echo " \x1b[33;1mtest: \x1b[0mruns pytest"
4+
@echo " \x1b[33;1mcoverage: \x1b[0mruns pytest with coverage report"
45
@echo " \x1b[33;1mlint: \x1b[0mformat code using black"
56
@echo "\x1b[33;1mset-up-hooks: \x1b[0mset up various git hooks"
67
@echo " \x1b[33;1mdev-install: \x1b[0minstall all packages required for development"
@@ -19,6 +20,11 @@ set-up-hooks:
1920
test:
2021
pytest ./tests/
2122

23+
coverage:
24+
coverage run -m pytest ./tests/
25+
coverage report -m
26+
coverage html
27+
2228
dev-install:
2329
pip install -r dev-requirements.txt
2430

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ uvicorn==0.18.2
8282
Werkzeug==2.0.3
8383
wrapt==1.13.3
8484
zipp==3.7.0
85+
coverage==6.3.2

0 commit comments

Comments
 (0)