-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make code coverage report available #2287
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
67ed723
run pytest from GHA environment instead of through Use Case Test acti…
georgemccabe 51588cb
set env var needed to run pytests
georgemccabe 952dc15
add lcov report
georgemccabe 57c45f9
pass coverage config file to pytest command
georgemccabe 4bda6d9
pass github token
georgemccabe 18d0fe2
call coverage to run pytests
georgemccabe 3a4211f
try running with lcov output
georgemccabe d4a2c56
moved file back to top level
georgemccabe cc1e640
use better shell syntax
georgemccabe 4e505be
try again
georgemccabe af99699
run debug
georgemccabe a2ba6b7
remove token and test if git is available
georgemccabe bdd1455
remove git test
georgemccabe 060e08c
try develop versiong
georgemccabe e258e27
add token using dev
georgemccabe feb6b88
try with lcov
georgemccabe c4f3caf
set source in coverage config
georgemccabe 4597024
run coverage then generate report
georgemccabe 2977a3b
split pytest run and coverage report into separate steps to catch fai…
georgemccabe c83575f
force tests to fall to ensure that failure is properly captured
georgemccabe 0d354c0
generate coverage report even if a test fails
georgemccabe 09a1317
require unit tests to pass to run use case tests
georgemccabe 6f69249
turn on use case group to test
georgemccabe 3aa3c6e
remove force failure of unit test to test that use case will run
georgemccabe ca2eb5f
turn off use case after test
georgemccabe 109316a
move helper script that is only used internally to internals directory
georgemccabe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
relative_files = True | ||
source = metplus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
certifi==2023.7.22 | ||
cftime==1.6.2 | ||
coverage==7.2.7 | ||
exceptiongroup==1.1.2 | ||
iniconfig==2.0.0 | ||
netCDF4==1.6.4 | ||
numpy==1.25.2 | ||
packaging==23.1 | ||
pandas==2.0.3 | ||
pdf2image==1.16.3 | ||
Pillow==10.0.0 | ||
pluggy==1.2.0 | ||
pytest==7.4.0 | ||
pytest-cov==4.1.0 | ||
python-dateutil==2.8.2 | ||
pytz==2023.3 | ||
six==1.16.0 | ||
tomli==2.0.1 | ||
tzdata==2023.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a
requirements.in
that is compiled withpip-compile
to check on versioning? Specifying the versions inrequirements.txt
without this (whether it bepoetry
/pipenv
/choose-your poison
is prone to error. Usingpip-compile
(and others) ensures you have all requirements, not just the ones you think you need.Additionally, why is this dev req hidden so deep in the directory structure? It's dev, but still top-level requirements files are easier to manage/build for your project. Would be beneficial to place it up top with your prod
requirements.txt
and rename torequirements-dev.txt
then you can includerequirements.txt
in yourrequirements-dev.txt
(if usingpip-compile
includerequirements.in
in yourrequirements-dev.in
) andpip
will know what to do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @halltristanj,
I have not used
pip-compile
but after a quick review it does sound like a good tool to help handle dependencies. I generated the file by creating a new environment, installing the packages I needed to run the unit tests, and ranpip freeze
.I created this requirements file to easily set up an environment to run the unit tests in GitHub Actions. I hadn't necessarily intended it to be used by other developers, although that would be nice to provide. It gets complicated because there are different types of contributors that need different optional dependencies for their work. For example, contributors working on the source code or unit tests will want the packages needed to run the unit tests, while contributors adding a new use case may only need the packages needed to build the documentation locally (found in docs/requirements.txt). The METplus Contributor's Guide contains some info to help developers obtain what they need for their work.
The changes in this pull request were added to more easily view the code coverage results because we have external contributors actively working on improving the code coverage of the tests. I appreciate your suggestions and will keep them in mind for when we are able to dedicate more time to improving these things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created GitHub issue #2289 to track this enhancement.