Skip to content

Commit 6ff792b

Browse files
Improve coverage-reports (#2945)
* Save coverage-report xml * Add contexts to coverage report
1 parent 454a08c commit 6ff792b

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.coveragerc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source = src/
44
branch = True
55
relative_files = True
6+
dynamic_context = test_function
67
omit =
78
# omit anything in a .local directory anywhere
89
*/.local/*
@@ -12,13 +13,15 @@ omit =
1213
./utest/*
1314
# robot library
1415
./src/robotide/lib/robot/*
16+
./src/robotide/preferences/configobj/*
1517
*/.venv/*
1618

1719
[report]
1820
skip_empty = True
1921
exclude_lines =
2022
if __name__ == '__main__':
21-
23+
if __name__ == '__main__' and 'robotide' not in sys.modules:
24+
2225
[xml]
2326
output = .coverage-reports/coverage.xml
2427

.github/workflows/fedora_41.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ jobs:
9393
- uses: actions/upload-artifact@v4
9494
with:
9595
name: coverage-report
96-
path: .coverage-reports/**
96+
path: |
97+
.coverage-reports/coverage.xml
98+
.coverage-reports/htmlcov
9799
- name: Install and run
98100
run: |
99101
git submodule update --init --recursive

.github/workflows/linux.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ jobs:
128128
- uses: actions/upload-artifact@v4
129129
with:
130130
name: coverage-report
131-
path: .coverage-reports/**
131+
path: |
132+
.coverage-reports/coverage.xml
133+
.coverage-reports/htmlcov
132134
- name: Install and run
133135
run: |
134136
git submodule update --init --recursive

tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ def test_ci(ctx, test_filter=''):
414414
a.communicate(b'')
415415
b = subprocess.Popen(["coverage", "run", "-a", "--data-file=.coverage.2", "-m", "pytest", "--ignore=utest/application/test_app_main.py", "--cov-config=.coveragerc", "-k test_", "-v", TEST_DIR])
416416
b.communicate(b'')
417-
c = subprocess.Popen(["coverage", "combine"])
417+
c = subprocess.Popen(["coverage", "combine"]) #, "--keep"
418418
c.communicate(b'')
419419
r = subprocess.Popen(["coverage", "report"])
420420
r.communicate(b'')
421421
x = subprocess.Popen(["coverage", "xml"])
422422
x.communicate(b'')
423-
h = subprocess.Popen(["coverage", "html"])
423+
h = subprocess.Popen(["coverage", "html", "--contexts=.*", "--show-contexts"])
424424
h.communicate(b'')
425425
finally:
426426
""" Nothing to do """

0 commit comments

Comments
 (0)