Hello! I’d like to set up test coverage reports for the systemd repository, however, I’m struggling to convince Codecov to actually process the uploaded reports.
The “workflow” is fairly simple:
$ git clone https://github.com/systemd/systemd $ cd systemd $ LDFLAGS='-lgcov --coverage' meson --werror -Dc_args="-O0 --coverage" build $ ninja -C build $ meson test -C build --print-errorlogs --timeout-multiplier=3
After this, all necessary reports are generated and the codecov-bash script correctly detects them:
==> Searching for coverage reports in: + . -> Found 3356 reports ==> Detecting git/mercurial file structure ==> Reading reports + ./build/systemd-resolved@exe/^#src#resolve#resolved-dns-scope.c.gcov bytes=59 + ./build/systemd-resolved@exe/^#src#resolve#resolved-dnstls-gnutls.c.gcov bytes=63
The word “correctly” is emphasized, due to these errors during the
File '../src/basic/fd-util.h' Lines executed:100.00% of 6 No branches Calls executed:100.00% of 2 Creating '^#src#basic#fd-util.h.gcov' Cannot open source file ../src/basic/fd-util.h File '../src/basic/alloc-util.h' Lines executed:0.00% of 3 No branches No calls Creating '^#src#basic#alloc-util.h.gcov' Cannot open source file ../src/basic/alloc-util.h
I couldn’t make the errors disappear using any combination of the
-R options for the
codecov-bash script. However, after inspecting the to-be-uploaded bundle, the paths look correct:
$ tail -n3 out.log ./src/random-seed/random-seed.c:2,14,16,30,36,41,43,48,52,53,60,62,63,71,73,74,81,83,84,89,93,94,99,100,102,103,112,114,118,120,122,126,129,131,135,137,141,147,150,154,157,159,163,167,174,177,181,185,188,203,204,212,214,216,223,227,233,236,237,238,241,245,249,256,257,258,259,262,268,275,282,291,292,296,299,303,310,311,313,314 ./src/vconsole/vconsole-setup.c:5,21,38,43,45,49,51,52,55,57,60,62,63,66,69,71,72,75,83,86,88,89,93,96,100,104,109,112,115,116,119,123,126,127,133,137,148,151,154,155,162,163,165,166,172,176,183,187,191,194,197,198,205,206,208,209,231,236,237,258,272,273,274,275,278,282,285,292,293,296,298,301,305,313,319,321,322,331,332,337,338,340,341,342,347,351,354,360,361,368,374,375,380,381,383,384,389,393,397,401,405,409,412,413,423,425,427,434,436,445,460,463,466,477,478,480 <<<<<< EOF
Right now I’m not sure if I’m missing something pretty obvious or the workflow has to be changed in some way. Few weeks ago I payed around with
gcov/lcov manually without such issues though.
The already uploaded reports can be found under the systemd Codecov project and also my fork where I experimented with various options.
 https ://codecov.io/gh/systemd/systemd/commits
 https ://codecov.io/gh/mrc0mmand/systemd/commits