You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was just looking into this for use in the GitHub actions beta, and covering my Python code, but it looks like the coverage tooling for Python doesn't support lcov output (ie running coverage.py via pytest-cov on pytest unittests).
I know that the coveralls Python library can interface with the coveralls.io API, so I'm curious what the suggested solution might be.
Any ideas?
Reacted by Pierre Nicolas Durette, Matthieu Rigal, Han, rraallvv, Hanusz Leszek, Marius Gedminas, Rico, G. P. Müller and Israel Mendes - Caylent
I'll give it a try, but is installing and running a Ruby gem the only option here? I've previously used a workflow on Travis that simply invokes the coveralls tool which uploads the output from coverage.py, which is nice since it's simply a case of installing an extra Python lib.
Reacted by Pierre Nicolas Durette, Will Barton, Han and Esteban C Borsani
I think I'm missing something; the coveralls-lcov tool doesn't output LCOV formatted data. It consumes LCOV data to output jsonLooking at the coveralls Python library, is it not possible to use the api/v1/jobs endpoint since that appears to consume the more common JSON format instead of LCOV:
However, running just coveralls on a pull_request event does not prompt Coveralls.io to later on to add a comment to the PR, even though it is enabled in the Coveralls.io settings?
@hakonanes, There's also CI_PULL_REQUEST env var that you can set to something from ${{ github.event }} context or parse it out of the file at $GITHUB_EVENT_PATH
Did something change recently? This workflow was working with coveralls as of 12/14/2020 (build), yet now it does not?
Submitting coverage to coveralls.io...
Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
resubmitting with id None-4337388734212009414
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/coveralls/api.py", line 252, in wear
response.raise_for_status()
File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/coveralls/cli.py", line 85, in main
result = coverallz.wear()
File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/coveralls/api.py", line 255, in wear
raise CoverallsException('Could not submit coverage: {}'.format(e))
coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
Reacted by Benjamen Meyer, Flavio Curella, Bert Blommers and Petr Belskiy
You are correct about those environment variables. Due to the nature of GitHub App authentication, the Coveralls GitHub Action is the only Coveralls integration that must use the repo's GitHub token, rather than its Coveralls-assigned repo token, to identify the repo to the Coveralls API. The way to "trick" GitHub Actions into doing the same for other integrations is to pass COVERALLS_SERVICE_NAME=github, which is the reserved value for the Coveralls GitHub Action.
In other words, the Coveralls API thinks you're using the Coveralls GitHub Action and uses the GitHub token to ID your repo.
Note that v2.X will soon support python and other coverage formats due to using a different underlying integration, the Coveralls Universal Coverage Reporter.
Activity
nickmerwin commentedon Aug 20, 2019
Hi @aodj, could you try the steps described here:
https://github.com/coveralls-clients/coveralls-python/blob/master/docs/usage/multilang.rst
e.g.:
coveralls --output=coverage.json coveralls-lcov -v -n coverage.info > coverage.jsonThen use "./coverage.json" as the
path-to-lcovinput for the Coveralls Action.Let me know how it goes, thanks!
[-]Using for Python code an coverage.py[/-][+]Using for Python code and coverage.py[/+]aodj commentedon Aug 20, 2019
I'll give it a try, but is installing and running a Ruby gem the only option here? I've previously used a workflow on Travis that simply invokes the
coverallstool which uploads the output fromcoverage.py, which is nice since it's simply a case of installing an extra Python lib.aodj commentedon Aug 20, 2019
I think I'm missing something; the
coveralls-lcovtool doesn't output LCOV formatted data. It consumes LCOV data to outputjsonLooking at thecoverallsPython library, is it not possible to use theapi/v1/jobsendpoint since that appears to consume the more common JSON format instead of LCOV:aodj commentedon Sep 1, 2019
Any more thoughts on using the action with Python?
aodj commentedon Sep 9, 2019
Just to keep this ticket up-to-date I gave up with this action, and just used the
coverallsPython package. Workflow for reference.mikkokotila commentedon Sep 15, 2019
@aodj dead simple approach solves the issue. Which raises an important question; how come the official version from the company itself, does not work?
hakonanes commentedon Sep 18, 2019
However, running just
coverallson apull_requestevent does not prompt Coveralls.io to later on to add a comment to the PR, even though it is enabled in the Coveralls.io settings?abhinavsingh commentedon Oct 13, 2019
This probably should be re-opened or at-least put instructions for Python integration upfront in README.
Just use coveralls package. See coverallsapp/github-action#4
Try to follow coverallsapp/github-action#4 (comment)
jvesely commentedon Oct 28, 2019
Running just
coverallsin github actions reports branchHEAD. I ended up with:@hakonanes, There's also
CI_PULL_REQUESTenv var that you can set to something from${{ github.event }}context or parse it out of the file at$GITHUB_EVENT_PATHly-cultureiq commentedon Nov 4, 2019
if nickmerwin/node-coveralls#243 gets merged - i have a simple pr to add pytest and coverage.py support
ci: submit coverage information to coveralls.io
20 remaining items
Use AndreMiras' version of Coveralls action
Use AndreMiras' version of Coveralls action
Use AndreMiras' version of Coveralls action
Use AndreMiras' version of Coveralls action
Use AndreMiras' version of Coveralls action
[GitHub Actions] Setup Tests via Github Actions (#561)
Configure GitHub workflow to publish coverage
willronchetti commentedon Jan 15, 2021
Did something change recently? This workflow was working with coveralls as of 12/14/2020 (build), yet now it does not?
passed GITHUB_TOKEN for coveralls
Configure GitHub workflow to publish coverage
CI: Removed coveralls GitHub Action for coverage reporting as it does…
CI: add more github actions (#86)
Merge pull request coverallsapp#4 from avolantis/36-remove-lib
scottgigante commentedon Mar 7, 2023
This works for me:
afinetooth commentedon Mar 8, 2023
Hi @scottgigante.
Just FYI for anyone else reading:
You are correct about those environment variables. Due to the nature of GitHub App authentication, the Coveralls GitHub Action is the only Coveralls integration that must use the repo's GitHub token, rather than its Coveralls-assigned repo token, to identify the repo to the Coveralls API. The way to "trick" GitHub Actions into doing the same for other integrations is to pass
COVERALLS_SERVICE_NAME=github, which is the reserved value for the Coveralls GitHub Action.In other words, the Coveralls API thinks you're using the Coveralls GitHub Action and uses the GitHub token to ID your repo.
Note that
v2.Xwill soon support python and other coverage formats due to using a different underlying integration, the Coveralls Universal Coverage Reporter.