Skip to content

Commit 0722a2b

Browse files
benjefferymergify-bot
authored and
mergify-bot
committed
Fix coverage and add lwt coverage
1 parent 3ac620e commit 0722a2b

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

.circleci/config.yml

+25-30
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,9 @@ jobs:
5959
name: Run gcov & upload coverage.
6060
command: |
6161
cd build-gcc
62-
# TODO should be able to do this with 'find', but it's tricky and opaque.
63-
gcov -pb libtskit.a.p/tskit_core.c.gcno ../c/tskit/core.c
64-
gcov -pb libtskit.a.p/tskit_tables.c.gcno ../c/tskit/tables.c
65-
gcov -pb libtskit.a.p/tskit_trees.c.gcno ../c/tskit/trees.c
66-
gcov -pb libtskit.a.p/tskit_genotypes.c.gcno ../c/tskit/genotypes.c
67-
gcov -pb libtskit.a.p/tskit_core.c.gcno ../c/tskit/core.c
68-
gcov -pb libtskit.a.p/tskit_convert.c.gcno ../c/tskit/convert.c
69-
gcov -pb libtskit.a.p/tskit_stats.c.gcno ../c/tskit/stats.c
70-
gcov -pb libtskit.a.p/tskit_haplotype_matching.c.gcno ../c/tskit/haplotype_matching.c
71-
gcov -pb libtskit.a.p/tskit_file_format.c.gcno ../c/tskit/file_format.c
62+
find ../c/tskit/*.c -type f -printf "%f\n" | xargs -i gcov -pb libtskit.a.p/tskit_{}.gcno ../c/tskit/{}
7263
cd ..
73-
bash <(curl -s https://codecov.io/bash) -X gcov -n c_tests
64+
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -F c-tests
7465
7566
- run:
7667
name: Valgrind for C tests.
@@ -110,28 +101,41 @@ jobs:
110101
command: |
111102
make -C c/examples
112103
104+
- run:
105+
name: Build example LWT interface code and test
106+
command: |
107+
# We're assuming that the tskit C module has already
108+
# been built, as we're testing against the local tskit version.
109+
cd python/lwt_interface
110+
make allchecks
111+
python -m pytest
112+
113+
- run:
114+
name: Upload LWT coverage
115+
command: |
116+
# Make sure the C coverage reports aren't lying around
117+
rm -fR build-gcc
118+
ls -R
119+
cd python/lwt_interface
120+
gcov -pb -o ./build/temp.linux*/*.gcno example_c_module.c
121+
bash <(curl -s https://codecov.io/bash) -X gcov -F lwt-tests
122+
113123
- run:
114124
name: Run Python tests
115125
command: |
116126
cd python
117-
python -m pytest --cov=tskit --cov-report=xml --cov-branch -n8 tests
127+
python -m pytest --cov=tskit --cov-report=xml --cov-branch -n16 tests
118128
119129
- run:
120130
name: Upload Python coverage
121131
command: |
122132
# Make sure the C coverage reports aren't lying around
123133
rm -fR build-gcc
124-
bash <(curl -s https://codecov.io/bash) -X gcov -n python_tests
125-
# Clean up reports so we don't upload them twice.
126-
rm -f coverage.xml
127-
128-
# Upload coverage for the Python C API.
129134
cd python
130135
gcov -pb -o ./build/temp.linux*/*.gcno _tskitmodule.c
131-
cd ..
132-
bash <(curl -s https://codecov.io/bash) -X gcov -n python_c_tests
133-
# Clean up reports so we don't upload them twice.
134-
rm -f python/*.gcov
136+
bash <(curl -s https://codecov.io/bash) -f coverage.xml -F python-tests
137+
rm -f coverage.xml
138+
bash <(curl -s https://codecov.io/bash) -X gcov -F python-c-tests
135139
136140
- run:
137141
name: Build Python package
@@ -149,12 +153,3 @@ jobs:
149153
python setup.py bdist_wheel
150154
pip install dist/*.tar.gz
151155
tskit --help
152-
153-
- run:
154-
name: Build example LWT interface code and test
155-
command: |
156-
# We're assuming that the tskit C module has already
157-
# been built, as we're testing against the local tskit version.
158-
cd python/lwt_interface
159-
make allchecks
160-
python -m pytest

.codecov.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
comment:
2+
layout: "diff, flags, files"
13
coverage:
4+
require_ci_to_pass: false
25
status:
36
project:
47
python-tests:
58
target: 95%
6-
flags: python_tests
9+
flags: python-tests
710
python-c-tests:
811
target: 85%
9-
flags: python_c_tests
12+
flags: python-c-tests
1013
c-tests:
1114
target: 85%
12-
flags: c_tests
15+
flags: c-tests
16+
lwt-tests:
17+
target: 85%
18+
flags: lwt-tests

python/requirements/CI-complete/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ autodocsumm==0.2.1
33
biopython==1.78
44
black==20.8b1
55
breathe==4.23.0
6-
codecov==2.1.10
76
coverage==5.3
87
flake8==3.8.4
98
h5py==3.0.0

0 commit comments

Comments
 (0)