Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage and codecov #709

Closed
KrisThielemans opened this issue Jun 6, 2020 · 4 comments · May be fixed by #710
Closed

coverage and codecov #709

KrisThielemans opened this issue Jun 6, 2020 · 4 comments · May be fixed by #710

Comments

@KrisThielemans
Copy link
Member

doesn't look like .coverage is being generated (at least not in the expected location). TL;DR travis logs (after ctest passes):

$ pushd ../SIRF
$ codecov
    Error running `['/usr/bin/python2', '-m', 'coverage', 'xml', '-i']`: Command '['/usr/bin/python2', '-m', 'coverage', 'xml', '-i']' returned non-zero exit status 1
    - Ignored: [Errno 2] No such file or directory: '/home/travis/build/SyneRBI/SIRF/coverage.xml'
Error: No coverage report found
$ coveralls
coverage.misc.CoverageException: Data file '/home/travis/build/SyneRBI/SIRF/.coverage' doesn't seem to be a coverage data file: Couldn't use data file '/home/travis/build/SyneRBI/SIRF/.coverage': no such table: coverage_schema

Originally posted by @casperdcl in #614 (comment)

@KrisThielemans
Copy link
Member Author

@casperdcl That's for a Linux job. Indeed, there's no .coverage in SIRF. Who's supposed to make it?

OSX job

https://travis-ci.org/github/SyneRBI/SIRF/jobs/695339402#L16824-L16833

0.04s$ pushd ../SIRF
after_success.2
0.01s$ sed -r 's/SIRF-SuperBuild\/INSTALL\/python\/sirf\/(\w*)\.py/SIRF\/src\/x\1\/p\1\/\1.py/g' ../SIRF-SuperBuild/sources/SIRF/.coverage > .coverage
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
after_success.3
0.01s$ codecov
/Users/travis/.travis/functions: line 109: codecov: command not found
after_success.4
0.01s$ coveralls
/Users/travis/.travis/functions: line 109: coveralls: command not found

First item is probably because OSX sed doesn't like `-r.

Last item is probably because we should prefix with $PY_EXE as

- $PY_EXE -m pip install --user -U nose codecov coveralls requests

In fact, should we be running coverage etc on all Travis jobs?

@casperdcl
Copy link
Member

casperdcl commented Jun 6, 2020

Indeed, there's no .coverage in SIRF. Who's supposed to make it?

ctest should make it (assuming the underlying test frameworks generate coverage, e.g. python -m nose --with-coverage --cover-package=sirf or similar)

In fact, should we be running coverage etc on all Travis jobs?

yes we should if different jobs/platforms run different lines of code

@KrisThielemans
Copy link
Member Author

ok. ctest is indeed running
/usr/bin/python "-m" "nose" "--with-coverage" "--cover-package=sirf.Gadgetron" "src/xGadgetron/pGadgetron/"
etc.
I've tested it on the VM, and ctest makes ../sources/SIRF/.coverage. So I guess the Travis job writes it somewhere else

https://travis-ci.org/github/SyneRBI/SIRF/jobs/695339398#L1759 confirms we're building in

-DSIRF_SOURCE_DIR:PATH=/home/travis/build/SyneRBI/SIRF

https://travis-ci.org/github/SyneRBI/SIRF/jobs/695339398#L26582-L26583 says that we're indeed going there before running `sed

$ pushd ../SIRF
~/build/SyneRBI/SIRF ~/build/SyneRBI/SIRF-SuperBuild
$ sed -r 's/SIRF-SuperBuild\/INSTALL\/python\/sirf\/(\w*)\.py/SIRF\/src\/x\1\/p\1\/\1.py/g' ../SIRF-SuperBuild/sources/SIRF/.coverage > .coverage

So, it is likely that the sed is picking it up from the wrong place.

RE sed -r not being available on MacOS, looks like we can use sed -E, which works on Ubuntu as well. Note that "inplace" sed on MacOS seems tricky. oh well.

KrisThielemans pushed a commit to KrisThielemans/SIRF that referenced this issue Jun 6, 2020
coverage was broken in a few ways:
- .coverage was in a different place than we thought
- OSX sed doesn't support -r but needs -E
- we were not necessarily using the correct python
fixes SyneRBI#709
@KrisThielemans
Copy link
Member Author

outdated as we no longer use Travis.

we might be sorting this out for GHA in #1149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants