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

coveralls + travis + docker #88

Closed
condemil opened this issue Feb 15, 2019 · 4 comments
Closed

coveralls + travis + docker #88

condemil opened this issue Feb 15, 2019 · 4 comments

Comments

@condemil
Copy link

condemil commented Feb 15, 2019

I am using docker container with travis to test and generate coverage report. As I am aware (based on my experience with other languages) when you use coveralls with travis on public repositories you don't need to specify any additional tokens, however with coveralls.net I got this:

No token found in Environment Variable 'COVERALLS_REPO_TOKEN'.
coverall failed!

I passed the following environment variables to container:

ARG CI
ARG TRAVIS
ARG TRAVIS_BRANCH
ARG TRAVIS_COMMIT
ARG TRAVIS_JOB_ID
ARG TRAVIS_JOB_NUMBER
ARG TRAVIS_OS_NAME
ARG TRAVIS_PULL_REQUEST
ARG TRAVIS_PULL_REQUEST_SHA
ARG TRAVIS_REPO_SLUG
ARG TRAVIS_TAG
@csMACnz
Copy link
Owner

csMACnz commented Feb 15, 2019

As suggested, you will also need to pass in the COVERALLS_REPO_TOKEN environment variable as well. Usually when using docker, all environment variables need to be passed explicitly.

If you link to a public repository and build where you are having trouble with I could take a closer look, although I suspect this to be the problem.

@condemil
Copy link
Author

condemil commented Feb 18, 2019

Yes you can add COVERALLS_REPO_TOKEN in travis settings by copy-pasting it from coveralls, but this will be a way-around and not the way how other coveralls tools do that.

I took as an an example one implementation, here you have:

  1. Get service_name as travis-ci and data from TRAVIS_PULL_REQUEST and TRAVIS_JOB_ID environment variables
  2. Add it to data structure with names service_name , service_job_id and service_pull_request
  3. POST it to /api/v1/jobs together with other data that you already sending

You can also find service_name , service_job_id and service_pull_request for appveyor, buildkite, circle ci and jenkins in the same file.

@csMACnz
Copy link
Owner

csMACnz commented Feb 18, 2019

Apologies for the confusion. I have added the travis provider into the next release version code, but have not released it yet. Until this is released, all settings will need to be done explicitly.

The example of how to do this for now unfortunately is to specify all the command-line arguments against the tool, and then also specify all the environment variables used to docker as well.

My hope is that soon i can work on a further release including the Travis support automatically, and then you will only need to specify everything in docker once.

@csMACnz
Copy link
Owner

csMACnz commented May 7, 2022

I see the linked PR was a success so am closing this Issue.

@csMACnz csMACnz closed this as completed May 7, 2022
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