Skip to content

Commit 5062aef

Browse files
authored
Merge pull request #302 from QuanMPhm/185/coverage
Use coverage to measure code coverage in unit and e2e tests
2 parents 72b6e76 + b866c67 commit 5062aef

5 files changed

Lines changed: 11 additions & 2 deletions

File tree

.coveragerc.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
parallel = true
3+
patch = ["subprocess"]

.github/workflows/e2e-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
3030
- name: Run E2E Tests
3131
run: |
32-
pytest process_report/tests/e2e/test_e2e_pipeline.py -v -s --log-cli-level=INFO
32+
coverage run --source="." -m pytest process_report/tests/e2e/test_e2e_pipeline.py -v -s --log-cli-level=INFO
33+
coverage combine
34+
coverage html --fail-under=85 --omit "process_report/tests/**,process_report/util.py,process_report/institute_list_validate.py"
3335
env:
3436
CHROME_BIN_PATH: '/usr/bin/chromium'

.github/workflows/unit-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ jobs:
2323
2424
- name: Run unit tests
2525
run: |
26-
python -m pytest process_report/tests/unit
26+
coverage run --source="." -m pytest process_report/tests/unit
27+
coverage combine
28+
coverage html --fail-under=80 --omit "process_report/tests/**"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
!process_report/tests/e2e/test_data/test_invoices/*.csv
44
__pycache__/
55
*.py[cod]
6+
.coverage
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pytest
2+
coverage

0 commit comments

Comments
 (0)