-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update configuration to include test coverage
This includes adding necessary pip requirements, adding a `.coveragerc` file, updating the pytest configuration, and updating the `test` job in the `build` workflow for GitHub Actions.
- Loading branch information
Showing
5 changed files
with
34 additions
and
2 deletions.
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,12 @@ | ||
# This is the configuration for code coverage checks | ||
# https://coverage.readthedocs.io/en/latest/config.html | ||
|
||
[run] | ||
source = cisagov_lambda | ||
omit = | ||
branch = true | ||
|
||
[report] | ||
exclude_lines = | ||
if __name__ == "__main__": | ||
show_missing = true |
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 |
---|---|---|
|
@@ -7,5 +7,7 @@ lambda_build.zip | |
|
||
## Python ## | ||
__pycache__ | ||
.coverage | ||
.mypy_cache | ||
.pytest_cache | ||
.python-version |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[pytest] | ||
# Increase verbosity and display extra test summary info for tests that did not pass | ||
addopts = --verbose -ra | ||
# Increase verbosity, display extra test summary info for tests that did not | ||
# pass, and report test coverage information. | ||
addopts = --verbose -ra --cov |
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 |
---|---|---|
@@ -1,4 +1,15 @@ | ||
--requirement requirements.txt | ||
coverage | ||
# coveralls 1.11.0 added a service number for calls from | ||
# GitHub Actions. This caused a regression which resulted in a 422 | ||
# response from the coveralls API with the message: | ||
# Unprocessable Entity for url: https://coveralls.io/api/v1/jobs | ||
# 1.11.1 fixed this issue, but to ensure expected behavior we'll pin | ||
# to never grab the regression version. | ||
coveralls != 1.11.0 | ||
# This is required to install project dependencies so that pytest can be run | ||
# successfully. | ||
pipenv | ||
pre-commit | ||
pytest | ||
pytest-cov |