Skip to content
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

Using coveralls with arbitrary CI service #256

Closed
Silmathoron opened this issue Jan 13, 2021 · 2 comments
Closed

Using coveralls with arbitrary CI service #256

Silmathoron opened this issue Jan 13, 2021 · 2 comments

Comments

@Silmathoron
Copy link

Would it be possible to add a explanation in the docs on how to use coverall with arbitrary CI?
As far as I understood from previous discussions, even if I run a test on my laptop, I should be able to send it to coveralls.io.

Ideally, I'd like to find an example showing:

  1. how to to this using only .coveralls.yml
  2. how to do it using only environment variables.

I tried using the Azure workaround from the docs to use coveralls with SourceHut as a CI to no avail.

What I was using so far was a .coveralls.yml file containing:

service_name: sourcehut
repo_token: my-token

and the command CIRCLECI=1 CIRCLE_BRANCH=master CIRCLE_BUILD_NUM=$JOB_ID coveralls.

This leads to the following error with coverals 3.0

Submitting coverage to coveralls.io...
resubmitting with id 394610-3497017197683832333
Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
Traceback (most recent call last):
  File "/home/build/.local/lib/python3.8/site-packages/coveralls/api.py", line 252, in wear
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, 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 "/home/build/.local/lib/python3.8/site-packages/coveralls/cli.py", line 85, in main
    result = coverallz.wear()
  File "/home/build/.local/lib/python3.8/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

Running it in debug mode runs fine: CIRCLECI=1 CIRCLE_BRANCH=master CIRCLE_BUILD_NUM=$JOB_ID coveralls debug gives the following log.

@TheKevJames
Copy link
Owner

@Silmathoron with the linked PR (#300), this flow should now be much more clear -- please let me know if this works for you with the latest version! You can find the docs here

@Silmathoron
Copy link
Author

Yep, working fine now, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants