Skip to content

Commit 0d3b8ae

Browse files
Merge pull request #1440 from python-gitlab/test/functional-test-coverage
test(functional): start tracking functional test coverage
2 parents 45edae9 + dfa40c1 commit 0d3b8ae

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
env:
5656
TOXENV: ${{ matrix.toxenv }}
5757
run: tox
58+
- name: Upload codecov coverage
59+
uses: codecov/codecov-action@v1
60+
with:
61+
files: ./coverage.xml
62+
flags: ${{ matrix.toxenv }}
63+
fail_ci_if_error: true
5864

5965
coverage:
6066
runs-on: ubuntu-20.04

codecov.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
9+
comment:
10+
layout: "diff,flags,files"
11+
behavior: default
12+
require_changes: yes
13+
14+
github_checks:
15+
annotations: true

tox.ini

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,22 @@ commands = python setup.py build_sphinx
6666

6767
[testenv:cover]
6868
commands =
69-
pytest --cov gitlab --cov-report term --cov-report html \
69+
pytest --cov --cov-report term --cov-report html \
7070
--cov-report xml gitlab/tests {posargs}
7171

7272
[coverage:run]
7373
omit = *tests*
74+
source = gitlab
75+
76+
[pytest]
77+
script_launch_mode = subprocess
7478

7579
[testenv:cli_func_v4]
7680
deps = -r{toxinidir}/docker-requirements.txt
77-
commands = pytest --script-launch-mode=subprocess tools/functional/cli {posargs}
81+
commands =
82+
pytest --cov --cov-report xml tools/functional/cli {posargs}
7883

7984
[testenv:py_func_v4]
8085
deps = -r{toxinidir}/docker-requirements.txt
81-
commands = pytest tools/functional/api {posargs}
86+
commands =
87+
pytest --cov --cov-report xml tools/functional/api {posargs}

0 commit comments

Comments
 (0)