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 #3675

Closed
MetRonnie opened this issue Jul 2, 2020 · 3 comments
Closed

Coverage #3675

MetRonnie opened this issue Jul 2, 2020 · 3 comments
Labels
duplicate This is a duplicate of something else infrastructure GH Actions, Codecov etc.

Comments

@MetRonnie
Copy link
Member

I was trying to look up coverage and a look at https://codecov.io/gh/cylc/cylc-flow reveals it hasn't updated in 2 months. I'm guessing this was the move from Travis to GH Actions?

Pull requests welcome!

@kinow
Copy link
Member

kinow commented Jul 2, 2020

I think we disabled it to ease the migration to GH actions, but there were problems with the reported values.

IIRC, codecov didn't/doesn't merge the reports well, giving a different coverage value; see codecov/codecov-python#244

For this, we could either use line-coverage only, but I think branch-coverage is more helpful to guide someone writing tests; or use the number reported in codecov as a guideline/indicator, but still run the report locally for new features... or look at SonarCloud/coveralls/codacy/etc and see if their reporters log the correct value.

Also, it wasn't reporting subcommand coverage (there's an issue for that somewhere); see #3488

For this, there's a solution in the issue above that could work. An alternative is to monkey-patch cylc-flow classes to trigger a command telling coverage module that the tests is done. I remember looking into that issue, and with debug/trace enabled, it's possible to confirm that the coverage session was started successfully.

But because of the way we handle subcommands, the python process running the coverage session gets terminated without flushing the session data (hence empty report). If you set a breakpoint before the session is terminated, and flush it, the coverage is successfully reported. atexit could work, but would have to be only for tests (thus monkey-patching).

The solution proposed in the issue is probably the clean/simplest.

@MetRonnie
Copy link
Member Author

I now see there's already #3598 for this - it didn't show up when I searched yesterday for some reason

@MetRonnie MetRonnie added the duplicate This is a duplicate of something else label Jul 3, 2020
@hjoliver
Copy link
Member

hjoliver commented Jul 7, 2020

Closing as duplicate...

@hjoliver hjoliver closed this as completed Jul 7, 2020
@MetRonnie MetRonnie added the infrastructure GH Actions, Codecov etc. label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This is a duplicate of something else infrastructure GH Actions, Codecov etc.
Projects
None yet
Development

No branches or pull requests

3 participants