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

CI: move pytest configuration to pyproject.toml #5281

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Dec 17, 2021

Part of the pytest configuration was done through environment
variables in the .github/workflows/tests.sh. This is moved to the
pyproject.toml where the rest of the configuration is and as such
everything is one place.

The .coveragerc configuration file no longer seems necessary since the
configuration is specified directly.

@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #5281 (1924df8) into develop (163b383) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5281      +/-   ##
===========================================
+ Coverage    82.01%   82.01%   +0.01%     
===========================================
  Files          533      533              
  Lines        38243    38243              
===========================================
+ Hits         31361    31362       +1     
+ Misses        6882     6881       -1     
Flag Coverage Δ
django 77.04% <ø> (-0.02%) ⬇️
sqlalchemy 76.36% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/transports/plugins/local.py 81.71% <0.00%> (+0.26%) ⬆️

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 163b383...1924df8. Read the comment docs.

@sphuber sphuber requested a review from chrisjsewell December 17, 2021 14:49
pyproject.toml Outdated
@@ -57,7 +57,7 @@ max-locals = 20

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--benchmark-skip"
addopts = "--benchmark-skip --durations=50 --cov aiida --cov-report xml --cov-append --verbose"
Copy link
Member

Choose a reason for hiding this comment

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

The only problem is that it forces every run of pytest to be verbose now and output all the coverage, i.e. when I'm testing locally.
At least for verbose, I would rather have this set in the workflow job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, that's true. Maybe I move --cov aiida and --verbose to the actual invocation in tests.sh.

@sphuber sphuber force-pushed the fix/centralize-pytest-coverage-config branch 2 times, most recently from 313ebec to ee7d060 Compare December 17, 2021 21:12
@sphuber sphuber requested a review from chrisjsewell December 17, 2021 21:42
Part of the `pytest` configuration was done through environment
variables in the `.github/workflows/tests.sh`. This is moved to the
`pyproject.toml` where the rest of the configuration is and as such
everything is one place.

The `.coveragerc` configuration file no longer seems necessary since the
configuration is specified directly.
These options are only desirable for the test script run on the CI and
not if we run locally directly invoking `pytest`.
@sphuber sphuber force-pushed the fix/centralize-pytest-coverage-config branch from ee7d060 to 3069ce1 Compare January 13, 2022 18:45
@sphuber
Copy link
Contributor Author

sphuber commented Jan 13, 2022

@chrisjsewell want to have a final look at this one?

Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

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

Yeh should be fine cheers

@sphuber sphuber merged commit 9d2b0ac into aiidateam:develop Jan 16, 2022
@sphuber sphuber deleted the fix/centralize-pytest-coverage-config branch January 16, 2022 18:18
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