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

Fixes #1058: Track system-tests coverage in Codecov.io #1048

Merged

Conversation

jiridanek
Copy link
Contributor

@jiridanek jiridanek commented Apr 4, 2023

https://app.codecov.io/github/skupperproject/skupper-router/pull/1048

Doing code coverage on system_tests is cheating. It runs a lot of code without asserting anything about the vast majority of it. So, counting all the code that was run as "covered by tests" is untrue.

The better way to measure system tests coverage is not by counting source code lines, but by counting covered user-facing features and scenarios.

@ganeshmurthy lets see what this does; I have great expectations, but maybe I'm imagining it wrong, what this is going to do

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #1048 (84fb44b) into main (0f4e165) will increase coverage by 47.23%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1048       +/-   ##
===========================================
+ Coverage   30.85%   78.09%   +47.23%     
===========================================
  Files         174      236       +62     
  Lines       38052    60498    +22446     
  Branches     5331     5632      +301     
===========================================
+ Hits        11741    47244    +35503     
+ Misses      25155    10649    -14506     
- Partials     1156     2605     +1449     
Flag Coverage Δ
pysystemtests 87.21% <ø> (?)
pyunittests 54.50% <ø> (ø)
systemtests 72.03% <ø> (?)
unittests 27.37% <ø> (-3.49%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
calculator 30.97% <ø> (+0.11%) ⬆️
systemtests 78.68% <ø> (∅)

@jiridanek
Copy link
Contributor Author

jiridanek commented Apr 4, 2023

Looks like we can't collect python coverage while running tests in parallel, https://github.com/jiridanek/skupper-router/actions/runs/4609453728/jobs/8146605198#step:34:498

Also, we need to decide what to do with regards to coverage if tests fail, since CentOS tests currently rarely pass. There is some setting in codecov about this

codecov:
  require_ci_to_pass: true

and also the uploading github action step gets skipped if the previous step failed, so that codecov setting does not even get to play a role, currently

what you see in https://app.codecov.io/github/skupperproject/skupper-router/commit/b2095422f08b6d4e5b564e662a819a97a3a69210/tree is coverage from the even-numbered systemtests, because only shard 2 passed.

@ganeshmurthy thoughts?

@jiridanek
Copy link
Contributor Author

I expected some way in the codecov.io web ui to be able to show lines covered by tests uploaded under a particular flag

image

but, that does not seem to be the case, and all are lumped under https://app.codecov.io/github/skupperproject/skupper-router/commit/b2095422f08b6d4e5b564e662a819a97a3a69210/tree

It appears that I can filter out the flags in yaml, https://docs.codecov.com/docs/flags#hide-builds-eg-nightly-builds

flags:
  nightly:
    joined: false

@jiridanek
Copy link
Contributor Author

jiridanek commented Apr 4, 2023

Actually the coverage.py problem is something different, it is nedbat/coveragepy#883 (comment) and it is self-inflicted through the ctest -j.

@jiridanek
Copy link
Contributor Author

Hmm, looks like I won't be able to guess it. Let me try locally, hopefully I can put together something that works to report python coverage reliably.

Still, I don't want to indiscriminately squash systemtests and unittest coverage when showing the line-per-line coverage in codecov.io web ui...

@jiridanek jiridanek marked this pull request as draft April 5, 2023 18:11
@jiridanek jiridanek force-pushed the jd_2023_04_04_systemtests_codecov branch 3 times, most recently from e07e1de to e9edee3 Compare April 6, 2023 05:49
@jiridanek jiridanek force-pushed the jd_2023_04_04_systemtests_codecov branch from c9103db to 52573d0 Compare April 6, 2023 06:18
@jiridanek
Copy link
Contributor Author

jiridanek commented Apr 6, 2023

@jiridanek jiridanek marked this pull request as ready for review April 6, 2023 16:35
@jiridanek
Copy link
Contributor Author

@ganeshmurthy ok, this should be it. first ci run failed on network issue uploading to codecov.io, so I'm rerunning it again now, so that we see the results

@jiridanek jiridanek requested a review from kgiusti April 6, 2023 17:59
@jiridanek
Copy link
Contributor Author

Now the only coverage missing is what the embedded python interpreter runs from inside skrouterd. I don't consider resolving that in scope of this PR.

Copy link
Contributor

@ganeshmurthy ganeshmurthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this merged. Thanks for doing this.

@ganeshmurthy
Copy link
Contributor

Can you please add an issue for this and change the commit message to point to the new issue ? Thx

@jiridanek
Copy link
Contributor Author

Can you please add an issue for this and change the commit message to point to the new issue ? Thx

I'll do that, but in general, it seems fairly superfluous thing to do on GitHub, where PRs and Issues work very similarly and you can link PRs to releases, same as (or instead of) the issues.

For example, what's the point of having both #1053 and #1054 when you can link the PR to release and be done with it.

(On the other hand, issue like #1055 is helpful because it explains the background for the change. But, that can be just as well explained right in the PR comment #1056)

What does make sense, IMO, is to create issue when you don't want to immediately create the PR. But otherwise, just the PR suffices.

@jiridanek jiridanek linked an issue Apr 17, 2023 that may be closed by this pull request
@jiridanek jiridanek changed the title Track system-tests coverage in Codecov.io Fixes #1058: Track system-tests coverage in Codecov.io Apr 17, 2023
@jiridanek jiridanek merged commit 2206bab into skupperproject:main Apr 17, 2023
@jiridanek jiridanek deleted the jd_2023_04_04_systemtests_codecov branch April 17, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track system-tests coverage in Codecov.io
2 participants