Skip to content

Commit 6f2db85

Browse files
knoepfelmambelli
authored andcommitted
Fix coverage reporting.
For a long time we have not been able to accurately gauge our code coverage for decisionengine_modules. This was due to a misconfiguration.
1 parent a764562 commit 6f2db85

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
set -x
7777
python3 -m pip install --upgrade pip
7878
python3 -m pip install --upgrade wheel setuptools
79-
python3 -m pip install -r ${{ github.workspace }}/glideinwms/requirements.txt
79+
python3 -m pip install -r glideinwms/requirements.txt
8080
8181
- name: Install dependencies for DE Framework
8282
run: |
@@ -92,15 +92,15 @@ jobs:
9292
- name: Install DE Modules dependencies (runtime)
9393
run: |
9494
set -x
95-
cd ${{ github.workspace }}/decisionengine_modules
95+
cd decisionengine_modules
9696
python3 -m pip install --upgrade pip
9797
python3 -m pip install -e . --user
9898
python3 -m pip list --user
9999
100100
- name: Install dependencies (unit tests)
101101
run: |
102102
set -x
103-
cd ${{ github.workspace }}/decisionengine_modules
103+
cd decisionengine_modules
104104
python3 -m pip install --upgrade pytest
105105
python3 -m pip install -e .[develop] --user
106106
python3 -m pip list --user
@@ -114,15 +114,15 @@ jobs:
114114
- name: Run Unit Tests on Python ${{ matrix.python-version }}
115115
env:
116116
PYTEST_TIMEOUT: 90
117-
PYTHONPATH: ${{ github.workspace }}/../:${{ github.workspace }}
118-
COVERAGE_PROCESS_START: ${{ github.workspace }}/.coveragerc
117+
PYTHONPATH: ${{ github.workspace }}
119118
run: |
120-
cd ${{ github.workspace }}/decisionengine_modules
121-
pytest --cov-report term --cov-report xml --cov=decisionengine_modules --no-cov-on-fail
119+
cd decisionengine_modules
120+
pytest --cov-report term --cov-report xml --no-cov-on-fail --cov=./
122121
123122
- name: Upload coverage to Codecov
124123
uses: codecov/codecov-action@v3
125124
with:
125+
working-directory: decisionengine_modules
126126
flags: python-${{ matrix.python-version }}
127127

128128
build_doc:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ write_to = "src/decisionengine_modules/version.py"
77

88
[tool.pytest.ini_options]
99
minversion = "6.0"
10-
addopts = "-l -v --durations=0"
10+
addopts = "-l -v --durations=0 -n 4"
1111
log_level = "debug"
1212
testpaths = "src/decisionengine_modules"
1313
timeout = 120

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
"pytest >= 6.2.2, < 7.0", # pytest 7 incompatible with pytest-postgres < 4 from DE
4545
"pytest-cov >= 2.11.1",
4646
"pytest-flake8 >= 1.0.7",
47+
"pytest-xdist[psutil] >= 2.3.0",
48+
"coverage == 6.1.2", # https://github.com/nedbat/coveragepy/issues/1300
4749
"tabulate >= 0.8.8",
4850
"toml >= 0.10.2",
4951
"pyyaml >= 5.4.1",

src/decisionengine_modules/util/test/test_retry_function.py renamed to src/decisionengine_modules/util/tests/test_retry_function.py

File renamed without changes.

0 commit comments

Comments
 (0)