-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add Coveralls GitHub Action #940
Conversation
Run coverallsapp/github-action@master
with:
github-token: ***
path-to-lcov: OpenOversight/tests/coverage.xml
coveralls-endpoint: https://coveralls.io/
debug: false
env:
FLASK_APP: OpenOversight.app
Using lcov file: OpenOversight/tests/coverage.xml
Error: ENOENT: no such file or directory, open 'OpenOversight/tests/coverage.xml' Here's the error I'm ending the day on. I'm gettin' REAL CLOSE. |
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.
Feel free to merge if this looks good to you
Makefile
Outdated
@@ -48,9 +48,9 @@ populate: create_db ## Build and run containers | |||
.PHONY: test | |||
test: start ## Run tests | |||
if [ -z "$(name)" ]; then \ | |||
FLASK_ENV=testing docker-compose run --rm web pytest --doctest-modules -n auto --dist=loadfile -v OpenOversight/tests/; \ | |||
FLASK_ENV=testing docker-compose run --rm web pytest --cov=OpenOversight --cov-report xml:OpenOversight/tests/coverage.xml --doctest-modules -n auto --dist=loadfile -v OpenOversight/tests/; \ |
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.
These are only used for local testing, but it seems fine to generate coverage reports here as well
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.
Ahhhh, that's right! If we can just have them as printouts for local testing, I think that'd be sufficient. I'll make the small adjustment.
FLASK_ENV=testing docker-compose run --rm web pytest --doctest-modules -n auto --dist=loadfile -v OpenOversight/tests/; \ | ||
FLASK_ENV=testing docker-compose run --rm web pytest --cov --doctest-modules -n auto --dist=loadfile -v OpenOversight/tests/; \ | ||
else \ | ||
FLASK_ENV=testing docker-compose run --rm web pytest --doctest-modules -v OpenOversight/tests/ -k $(name); \ | ||
FLASK_ENV=testing docker-compose run --rm web pytest --cov --doctest-modules -v OpenOversight/tests/ -k $(name); \ |
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 don't think we need the coverage files for local testing, but the coverage statistics are helpful to have when running make test
.
.github/workflows/test_coverage.yml
Outdated
- develop | ||
- main |
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.
The other yml
files callout develop
and main
, so I figured it'd be good for uniformity to do the same within this file as well.
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 reverted this change because we only track coverage on the develop branch.
- develop | ||
- main | ||
- develop | ||
- main |
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.
Consistent spacing between yml
files.
Fixes issue
#914
#937
Description of Changes
This PR creates a Coveralls GitHub action that sends our code coverage to its respective portal and fixes the broken link that was in the
README
.Notes for Deployment
Tests and linting
develop
branch.pytest
passes on my local development environment.pre-commit
passes on my local development environment.