Giter Site home page Giter Site logo

"raw" upload command? about codecov-bash HOT 10 CLOSED

codecov avatar codecov commented on May 26, 2024
"raw" upload command?

from codecov-bash.

Comments (10)

stevepeak avatar stevepeak commented on May 26, 2024 1

Hey @gliptak Yes this does indeed work for go: https://github.com/codecov/example-go

You can configure your own http post of report content to Codecov if the shell script is not desired. We are also looking into packaged options, e.g., apt-get, yum, etc.

You can also use the python package: pip install --user codecov && codecov.

Thanks!

from codecov-bash.

gliptak avatar gliptak commented on May 26, 2024

Thank you for the pointer. Would you have also have details on the parameters of HTTP post (an maybe a wget/curl example)?

from codecov-bash.

stevepeak avatar stevepeak commented on May 26, 2024

Sure :)

Here is the minimum requirements, you can discover the remaining arguments here

curl -X POST \
  -H 'Accept: application/json' \
  --data-binary @coverage.txt \
  "https://codecov.io/upload/v2?commit=<sha>&token=<uuid-token>"

from codecov-bash.

gliptak avatar gliptak commented on May 26, 2024

I came up with (public repo so no token required?):

curl -X POST -H 'Accept: application/json' --data-binary @coverage.txt "https://codecov.io/upload/v2?commit=$TRAVIS_COMMIT&pr=$TRAVIS_PULL_REQUEST&slug=$TRAVIS_REPO_SLUG"

but it throws No such file or directory

Would I need additional parameters?

https://travis-ci.org/cloudflare/cloudflare-go/jobs/196191034

from codecov-bash.

stevepeak avatar stevepeak commented on May 26, 2024

Hey @gliptak

No such file or directory would be an issue with the file coverage.txt not existing. I'm not sure what your coverage file name is, but it appears to not be coverage.txt. I just used that name as an example. The bash uploader can detect common files names here.

There are other requirements for the "no token" feature with travis. Please check them all out here.

Thank you! I'm happy to help our more 👍

from codecov-bash.

gliptak avatar gliptak commented on May 26, 2024

@stevepeak Thank you for helping me with this.

https://travis-ci.org/cloudflare/cloudflare-go/jobs/196438911

$ ls -l coverage.txt
-rw-r--r-- 1 travis travis 23538 Jan 29 22:48 coverage.txt
$ {:"curl -X POST -H 'Accept"=>"application/json' --data-binary @coverage.txt \"https://codecov.io/upload/v2?commit=$TRAVIS_COMMIT&pr=$TRAVIS_PULL_REQUEST&slug=$TRAVIS_REPO_SLUG\""}
/home/travis/build.sh: line 57: application/json' --data-binary @coverage.txt "https://codecov.io/upload/v2?commit=79f713c3504b71309726644ee12a9c85a76ed0cb&pr=111&slug=cloudflare/cloudflare-go"}: No such file or directory

If the coverage.txt files exists, what other reasons might be for No such file or directory?

from codecov-bash.

stevepeak avatar stevepeak commented on May 26, 2024

Can you try this:

- $ {:"curl -X POST -H 'Accept"=>"application/json' --data-binary @coverage.txt \"https://codecov.io/upload/v2?commit=$TRAVIS_COMMIT&pr=$TRAVIS_PULL_REQUEST&slug=$TRAVIS_REPO_SLUG\""}
+ curl -X POST --data-binary @coverage.txt "https://codecov.io/upload/v2?commit=$TRAVIS_COMMIT&pr=$TRAVIS_PULL_REQUEST&slug=$TRAVIS_REPO_SLUG"

I have not used the prior technique and this /home/travis/build.sh: line 57: application/json' tells me something is wrong with the format.

from codecov-bash.

gliptak avatar gliptak commented on May 26, 2024

OK, an actual error, a bit confusing as we should be able to skip the token?

https://travis-ci.org/cloudflare/cloudflare-go/jobs/196470037

<div class="status">400</div>
<div class="reason">Please provide the repository token to upload reports via `-t :repository-token`</div>

from codecov-bash.

stevepeak avatar stevepeak commented on May 26, 2024

This would be from the lack of Travis variables provided. I should have included them in the full request. So here we go 😄

curl -X POST --data-binary @coverage.txt "https://codecov.io/upload/v2?commit=$TRAVIS_COMMIT&pr=$TRAVIS_PULL_REQUEST&slug=$TRAVIS_REPO_SLUG&job=$TRAVIS_JOB_ID&build=$TRAVIS_JOB_NUMBER&branch=$TRAVIS_BRANCH"

Note the addition of job and build arguments.

from codecov-bash.

gliptak avatar gliptak commented on May 26, 2024

Still wants the token ...

https://travis-ci.org/cloudflare/cloudflare-go/jobs/196819806#L354

<div class="status">400</div>
<div class="reason">Please provide the repository token to upload reports via `-t :repository-token`</div>

from codecov-bash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.