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

Improve test coverage #93

Closed
adam2392 opened this issue Aug 5, 2022 · 6 comments
Closed

Improve test coverage #93

adam2392 opened this issue Aug 5, 2022 · 6 comments

Comments

@adam2392
Copy link
Member

adam2392 commented Aug 5, 2022

Looks like the main parts to improve are annotations submodule. We should also ignore the commands submodule probably. I think getting those two fixed should bring our test coverage to 90+

Screen Shot 2022-08-05 at 11 01 22 AM

@mscheltienne
Copy link
Member

The display is a bit miss-leading here, the commands module is already ignored:

mne-icalabel/pyproject.toml

Lines 168 to 178 in a09dddc

[tool.coverage.run]
branch = true
cover_pylib = false
source = [
'mne_icalabel',
]
omit = [
'**/__init__.py',
'mne_icalabel/commands/*',
'**/tests/**',
]

It was added as part of #88

@mscheltienne
Copy link
Member

And you need to click on commands to 'see' that it's ignored:

Screenshot 2022-08-05 at 17 05 55

If you remove the module from the omit argument, instead of a white square it will show 0%.

@mscheltienne
Copy link
Member

Now, codecov reports 89.71%. There is definitely a configuration issue, the 93.31% I was getting via pytest --cov-report term-missing --cov=mne_icalabel mne_icalabel made more sense.

image

@adam2392
Copy link
Member Author

adam2392 commented Aug 9, 2022

Hmm must be something fishy w/ codecov itself then. It seems like its somehow caching the commands/ submodule, when we told it to omit it.

@mscheltienne
Copy link
Member

Yes exactly.. The configuration in pyproject.toml is:

[tool.coverage.run]
branch = true
cover_pylib = false
source = [
    'mne_icalabel',
]
omit = [
    '**/__init__.py',
    'mne_icalabel/commands/*',
    'mne_icalabel/_version.py',
    '**/tests/**',
]

[tool.coverage.report]
exclude_lines = [
    'pragma: no cover',
    'if __name__ == .__main__.:',
]
precision = 2

And there is actually an omit argument for [tool.coverage.report] as well. I did try it in one of the commits of #94 and it did not change anything as far as Codecov is concerned. I did not find any configuration set for Codecov, neither at the repository or at the organization level that could explain it.

@mscheltienne
Copy link
Member

New configuration is handling this better. Coverage at 91.63%.

Screenshot from 2023-10-27 15-19-20

Closing, feel free to re-open if you want to keep this open for the annotation module.

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

No branches or pull requests

2 participants