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

Re-enable test coverage #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kinow
Copy link
Contributor

@kinow kinow commented Oct 7, 2021

Hi,

I haven't looked at the git log to confirm, but looking at codecov it looks like even though we are running it in GH actions, the coverage command is not able to locate any coverage information.

The last reported coverage in Codecov for janis-core is from 3rd June 2021. This PR includes the configuration for pytest, pytest-cov, and coverage/codecov to produce the .coverage file locally. The build time might increase a little, since running the tests will include coverage by default. If that's a problem I can think of some ways to have it enabled only for GH Actions 👍

Draft until CI runs and I can confirm it worked as expected on my branch and in codecov.

Bruno

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2021

Codecov Report

Merging #104 (d85a730) into master (ef1ba7b) will decrease coverage by 9.63%.
The diff coverage is 24.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
- Coverage   67.36%   57.73%   -9.64%     
==========================================
  Files          79       48      -31     
  Lines       10789     7639    -3150     
  Branches        0     1594    +1594     
==========================================
- Hits         7268     4410    -2858     
+ Misses       3521     2848     -673     
- Partials        0      381     +381     
Impacted Files Coverage Δ
janis_core/tool/test_suite_runner.py 53.33% <0.00%> (-11.38%) ⬇️
janis_core/translations/translationbase.py 63.25% <ø> (-6.30%) ⬇️
janis_core/ingestion/fromwdl.py 14.82% <11.11%> (+14.82%) ⬆️
janis_core/types/common_data_types.py 57.11% <50.00%> (-3.87%) ⬇️
janis_core/__meta__.py 100.00% <100.00%> (ø)
janis_core/tool/test_classes.py 89.18% <100.00%> (-4.00%) ⬇️
janis_core/utils/__init__.py 46.83% <0.00%> (-18.99%) ⬇️
janis_core/utils/docparser_info.py 79.16% <0.00%> (-14.59%) ⬇️
janis_core/utils/validators.py 73.91% <0.00%> (-13.05%) ⬇️
janis_core/translations/cwl.py 66.09% <0.00%> (-11.17%) ⬇️
... and 59 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 714eab7...d85a730. Read the comment docs.

@kinow kinow marked this pull request as ready for review October 7, 2021 02:24
@kinow
Copy link
Contributor Author

kinow commented Oct 7, 2021

Oh, looks like it works! ☝️

Previously, the coverage included the test code. I've removed those files from the coverage report, and was expecting a drop in coverage. Also, there might be some new code and/or tests added since the last run, so a decrease is probably OK.

@@ -1,6 +1,6 @@
name: Unit Tests

on: [push]
on: [push, pull_request]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be OK to include pull_request too?

@@ -0,0 +1,7 @@
[pytest]
addopts =
--cov
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line will be picked up by pytest, so it will invoke the pytest-cov plug-in (added to the requirements/tests.txt file).

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.

2 participants