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

Misc CI improvements #289

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# SPDX-License-Identifier: MIT

test_template: &test
environment:
CODECOV_TOKEN: ENCRYPTED[e18180139fa0a70726bb6f8dfbbc9fd53da36e6a4d2b449e30f99a255fdfdab63863117e8b6665deb06dd99d95e5aaad]
test_script:
- command -v python3
- python3 --version
- python3 -m pip install .[test]
- python3 -m pytest
- python3 -m pip install .[test] pytest-codecov
- python3 -m pytest --showlocals -vv --cov --cov-report=xml:coverage-$CIRRUS_TASK_NAME.xml --codecov
Copy link
Member

Choose a reason for hiding this comment

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

What's the point of reporting coverage data to codecov if we don't do anything with it? I would just get rid of the coverage reporting altogether.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do, https://github.com/seantis/pytest-codecov is a plugin to upload the coverage data.

Copy link
Member

Choose a reason for hiding this comment

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

I know, but where is the data visualized?

Copy link
Member Author

Choose a reason for hiding this comment

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

https://app.codecov.io/gh/mesonbuild/meson-python/ and the badge in the README and docs. I'd like to improve the coverage, so IMO it's definitely useful.

Copy link
Member

Choose a reason for hiding this comment

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

There must be something wrong with the codevcov.io: it does not point to the source code in this repository. and looking at the details for any given file just shows "There was a problem getting the source code from your provider. Unable to show line by line coverage."

I don't expect that running the code on different flavors of Linux will exercise different code paths, and this doubles the CI execution time. I prefer fast feedback loops. Are we sure we really need this? Does codecov provide a measure of how much each "measurement" from each test run contributes to the total coverage?


alpine-3_task:
container:
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ known_first_party = 'mesonpy'
disable_warnings = [
'couldnt-parse',
]
source = ['.']
omit = [
'tests/packages/*',
]

[tool.coverage.report]
ignore_errors = true
exclude_lines = [
'\#\s*pragma: no cover', # we need this because this field overrides the default
'^\s*raise NotImplementedError\b',
Copy link
Member

Choose a reason for hiding this comment

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

Why exclude raise NotImplementedError? Error conditions are supposed to be tested as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but NotImplementedError is for something that is supposed to work eventually, but doesn't currently, so it's different from something where we do actually intent on throwing an error. Writting tests to see if something raises NotImplementedError doesn't seem very productive, I'm not really sure what actual value it brings on most situations.

'^\sif typing.TYPE_CHECKING',
]

[tool.coverage.html]
show_contexts = true
Expand Down