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

Increasing glob-like omission of coverage files #1137

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

arjunsavel
Copy link
Contributor

@arjunsavel arjunsavel commented Apr 22, 2020

Description

  • Replaced all file names that include version in the coveragerc file with a single *version*
  • Replaced all file names that include __init__.py in the coveragerc file with a single *__init__*

Motivation and Context

The coveragerc file allows us to omit certain files in our test coverage calculations. However, some __init__.py files have slipped through, artificially increasing the coverage percentage reported by coveralls. Using glob-like notation catches all __init__ files. Introducing glob-like notation also future-proofs the code; if future modules with __init__.py files are added, these files needn't be manually added to coveragerc. This method has already been used for other file types (e.g. tardis/montecarlo/tests/*), so this PR simply extends that logic.

How Has This Been Tested?

I've tried testing this locally by running the advanced unit tests (python setup.py test --args="--tardis-refdata=/Users/arjunsavel/desktop/research/supernovae/tardis-refdata") and subsequently checking any produced .coverage files (coverage report -m), but it seems that the coveragerc does not affect this test; files that are not included in the coveralls calculation are included in this calculation. For example, the coveralls calculation does not include any files corresponding to tardis/montecarlo/tests/*, per the coveragerc file, but these files are included in the local coverage report. I am therefore confident that *__init__* and *version* should work as expected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@wkerzendorf wkerzendorf merged commit 46989f4 into tardis-sn:master Apr 28, 2020
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
* changed all init files omitted in coveragearc to globlike *__init__*

* changed all version files omitted in coveragearc to globlike *version*
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