-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
WIP Coverage reports #122
WIP Coverage reports #122
Conversation
Hi @chris48s thanks for starting work on this, I am not sure we need to add COVERALLS_REPO_TOKEN for open source projects? I was thinking maybe coveralls is able just to read that directly from the setup in coverrals.io but am not sure. I am tryna get some reference on this. But I may be wrong |
The only CI coveralls has that integration with is travis CI. For any other CI (e.g: Circle CI, or in our case GitHub actions) I think we do need the token to post the coverage report. I've pushed 2332c2f to demonstrate this. Note the build fails with Starting db ...
Starting db ... done
Not on TravisCI. You have to provide either repo_token in .coveralls.yml or set the COVERALLS_REPO_TOKEN env var.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/coveralls/cli.py", line 61, in main
service_name=options['--service'])
File "/usr/local/lib/python3.7/site-packages/coveralls/api.py", line 64, in __init__
self.ensure_token()
File "/usr/local/lib/python3.7/site-packages/coveralls/api.py", line 73, in ensure_token
self.config_filename))
coveralls.exception.CoverallsException: Not on TravisCI. You have to provide either repo_token in .coveralls.yml or set the COVERALLS_REPO_TOKEN env var.
##[error]Process completed with exit code 1. |
d7a2a1b
to
5e54191
Compare
Right then. Coveralls is going to be a pain because we:
For more details see:
Easy solution is: use codecov instead. Codecov has a github action which allows us to upload an XML coverage report without a token as long as the repo is public. _____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-tbd
==> GitHub Actions detected.
project root: .
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./project/coverage.xml bytes=18190
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=issue120&commit=5446dbcc24450e21f742577802ff1d0bf77f3f1d&build=66008864&build_url=http%3A%2F%2Fgithub.com%2Fcodebuddies%2Fbackend%2Factions%2Fruns%2F66008864&name=&tag=&slug=codebuddies%2Fbackend&service=github-actions&flags=&pr=122&job=
-> Pinging Codecov
https://codecov.io/upload/v4?package=bash-tbd&token=secret&branch=issue120&commit=5446dbcc24450e21f742577802ff1d0bf77f3f1d&build=66008864&build_url=http%3A%2F%2Fgithub.com%2Fcodebuddies%2Fbackend%2Factions%2Fruns%2F66008864&name=&tag=&slug=codebuddies%2Fbackend&service=github-actions&flags=&pr=122&job=
-> Uploading
-> View reports at https://codecov.io/github/codebuddies/backend/commit/5446dbcc24450e21f742577802ff1d0bf77f3f1d I've submitted a request to enable the codecov integration on this repo which will allow codecov to report on pull requests (I've not used codecov before, but hopefully once the app is enabled we should be able to test that with another push to this branch even though we don't have a cov report from master to compare to yet 🤞 ) |
Saw and approved this just now; please let me know if you need anything else, @chris48s! |
Looks like we're at 78%. WOOT! (and...I gotta get busy getting that number up!!). Here is the URL I am seeing: https://codecov.io/gh/codebuddies/backend/commits. Nice Work @chris48s ! Dunno if we want to play with a way we can use their SVG visualizations to report on coverage..but they're kinda cool: https://codecov.io/gh/codebuddies/backend/commit/5446dbcc24450e21f742577802ff1d0bf77f3f1d/graphs |
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.
Nice work. Thank you for doing this (twice!) and for debugging it!
If you set up a Personally I find the diff most useful, but have a play with it.. |
actually, having looked at the comments on other issues, |
Closes #120
This build is probably going to fail too when it tries to submit the coverage report.
I've set up this repo on coveralls at https://coveralls.io/github/codebuddies/backend
This missing piece of the jigsaw on this one is I we need to set
COVERALLS_REPO_TOKEN
in the repo secrets so that we can POST the coverage report, but I don't have access to do this.Can someone with access to modify the repo secrets:
COVERALLS_REPO_TOKEN
and the value as the token we copiedThen let me know. I'll confirm this works and we can wrap this one up.
Alternatively, if you'd rather use a different coverage service, let me know and we can revisit it..
Edit: gah - meant to create this as a draft PR 🙄