cainus / codecov.io Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
edit moved to codecov/codecov-node#59
I am trying to test the upload manually
export CODECOV_TOKEN="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
cat ./coverage/lcov.info | ./node_modules/.bin/codecov
but I am getting
node_modules/codecov.io/lib/getConfiguration.js:27
throw new Error("unknown service. could not get configuration");
^
Error: unknown service. could not get configuration
at module.exports (node_modules/codecov.io/lib/getConfiguration.js:27:13)
at sendToCodecov (node_modules/codecov.io/lib/sendToCodeCov.io.js:11:15)
at Socket.<anonymous> (node_modules/codecov.io/bin/codecov.io.js:14:5)
at emitNone (events.js:72:20)
at Socket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:903:12)
at doNTCallback2 (node.js:439:9)
at process._tickCallback (node.js:353:17)
If using the binary ./node_modules/.bin/codecov
, there's a path issue:
11-May-2015 15:55:42 module.js:340
11-May-2015 15:55:42 throw err;
11-May-2015 15:55:42 ^
11-May-2015 15:55:42 Error: Cannot find module '../lib/sendToCodeCov.io'
11-May-2015 15:55:42 at Function.Module._resolveFilename (module.js:338:15)
11-May-2015 15:55:42 at Function.Module._load (module.js:280:25)
11-May-2015 15:55:42 at Module.require (module.js:364:17)
11-May-2015 15:55:42 at require (module.js:380:17)
11-May-2015 15:55:42 at Object.<anonymous> (/home/bamboo/bamboo-agent-home/xml-data/build-dir/REAC-RCSW-UT/node_modules/.bin/codecov:2:21)
11-May-2015 15:55:42 at Module._compile (module.js:456:26)
11-May-2015 15:55:42 at Object.Module._extensions..js (module.js:474:10)
11-May-2015 15:55:42 at Module.load (module.js:356:32)
11-May-2015 15:55:42 at Function.Module._load (module.js:312:12)
11-May-2015 15:55:42 at Function.Module.runMain (module.js:497:10)
Using directly ./node_modules/codecov.io/bin/codecov.io.js
fix this.
/Users/Ilan/Development/hths-lunch/node_modules/codecov.io/lib/getConfiguration.js:19
throw new Error("unknown service. could not get configuration");
^
Error: unknown service. could not get configuration
at module.exports (project/node_modules/codecov.io/lib/getConfiguration.js:19:11)
at sendToCodecov (project/node_modules/codecov.io/lib/sendToCodeCov.io.js:12:23)
at Socket. (project/node_modules/codecov.io/bin/codecov.io.js:14:5)
at Socket.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
passing in 'mocha-lcov-reporter' to gulp-mocha.
Would also be nice to have better errors.
I am getting this error in windows because of the way the find command uses its dashes and cant get past it and it is crashing my build :
C:\callscreen\coverage\PhantomJS 2.0.0 (Windows 8 0.0.0)>codecov
/ | | |
| | ___ | | ___ ___ ___ __
| | / _ \ / ` |/ _ / __/ _ \ \ / /
| |**| () | (| | __/ (| () \ V /
****/ **,||****/ /
v1.0.1
==> Detecting CI Provider
No CI Detected. Using git/mercurial
==> Configuration:
Endpoint: https://codecov.io
{ commit: '1ed0fcce4fab96b2367937a986bea916021491e3',
branch: 'develop',
token: 'asdasd',
package: 'node-v1.0.1' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
$ find . -type f -name '.gcno' -exec gcov {} +
File not found - '_.gcno'
Failed to run gcov command.
==> Scanning for reports
FIND: Parameter format not correct
child_process.js:484
throw err;
^
Error: Command failed: find . -type f ( -name 'coverage.' -or -name 'nosetests.xml' -or -name 'jacoco_.xml' -or -name 'clover.xml' -or -name 'report.xml' -or -name 'cobertura.xml' -or -name 'luacov.report.out' -or -name 'lcov.info' -or -name '.lcov' -or -name 'gcov.info' -or -name '.gcov' -or -name '.lst' ) -not -name '.sh' -not -name '.data' -not -name '.py' -not -name '.class' -not -name '.xcconfig' -not -name 'Coverage.profdata' -not -name 'phpunit-code-coverage.xml' -not -name 'coverage.serialized' -not -name '.pyc' -not -name '.cfg' -not -name '.egg' -not -name '.whl' -not -name '.html' -not -name '.js' -not -name '.cpp' -not -name 'coverage.jade' -not -name 'include.lst' -not -name 'inputFiles.lst' -not -name 'createdFiles.lst' -not -name 'coverage.html' -not -name 'scoverage.measurements.' -not -name 'test___coverage.txt' -not -path '/vendor/' -not -path '/htmlcov/' -not -path '/home/cainus/' -not -path '/virtualenv/' -not -path '/js/generated/coverage/' -not -path '/.virtualenv/' -not -path '/virtualenvs/' -not -path '/.virtualenvs/' -not -path '/.env/' -not -path '/.envs/' -not -path '/env/' -not -path '/envs/' -not -path '/.venv/' -not -path '/.venvs/' -not -path '/venv/' -not -path '/venvs/' -not -path '/.git/' -not -path '/.hg/' -not -path '/.tox/' -not -path '/pycache/' -not -path '/.egg-info_' -not -path '/$bower_components/' -not -path '/node_modules/' -not -path '/conftest.c.gcov'
FIND: Parameter format not correct
at checkExecSyncError (child_process.js:441:13)
at execSync (child_process.js:481:13)
at Object.upload (C:\Users\AA Admin\AppData\Roaming\npm\node_modules\codecov\lib\codecov.js:260:18)
at Object.<anonymous> (C:\Users\AA Admin\AppData\Roaming\npm\node_modules\codecov\bin\codecov:24:9)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
Do you have a workaround for this or a parameter I can pass the file path on or something?
I'm under the impression that we should be using node-codecov from now on when publishing coverage reports to codecov.io.
Therefore, to prevent confusion within the Node community can this project be deprecated?
README.md
to mention that the package has been deprecated and where consumers should migrate.README.md
file is updated on the npm website.npm deprecate
to deprecate all versions of this package with a reference to the new package.It's unclear to me how I'm supposed to connect a private repository. We're using circleci as our build/test server, and I've got coverage stuff all generated, but when I try and run the following command as described in the documentation, I'm getting an error:
cat ./test/coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
configuration: { buildId: '47',
commitId: 'aee5a0e15e127a062719aaa7b8e45c45416c8d4f',
build: '47',
branch: 'master' }
Error: non-success response
at Request._callback (/home/ubuntu/RedoxEngine/node_modules/codecov.io/lib/sendToCodeCov.io.js:43:19)
at Request.self.callback (/home/ubuntu/RedoxEngine/node_modules/codecov.io/node_modules/request/request.js:236:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/home/ubuntu/RedoxEngine/node_modules/codecov.io/node_modules/request/request.js:1142:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/home/ubuntu/RedoxEngine/node_modules/codecov.io/node_modules/request/request.js:1096:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13) cat ./test/coverage/lcov.info | codecov_token=0d9aff38-9669-4afb-9641-e66ba33320a2 node ./node_modules/codecov.io/bin/codecov.io.js returned exit code 8
I have a feeling this has something to do with the private repository token, but I can't figure out where I'm supposed to set that. I tried setting it in the command like so:
cat ./test/coverage/lcov.info | codecov_token=<blablabla> node ./node_modules/codecov.io/bin/codecov.io.js
but that didn't work. Anyone have any guidance on what I'm supposed to be doing to get this to work?
There is a security flaw in hawk 1.1.1 (2.5 year old version), which is used by [email protected] (1.5 year old version), which is a dependency of codecov.io.
The current release of request is 2.69.1, updating shouldn't break anything, and that version of request uses hawk 3.1.0, while still not the most recent version, it's the last minor version of hawk v3.
Could you support passing the filepath and avoid using FIND command in order to find my lcov.info ?
something like codecov --token=123123 --filepath=coverage/lcov.info
Would be greatly appreciated
Could we add support for setting your repo token via CODECOV_TOKEN
env variable. Passing the variable in the url query as token=:token
.
Thanks!
Customer had issue via Twitter
Environment variables has to bet set manually before calling the command.
Following Travis variable names, it would look like:
BAMBOO=true BAMBOO_JOB_ID=${bamboo.agentId} BAMBOO_COMMIT=${bamboo.planRepository.revision} BAMBOO_JOB_NUMBER=${bamboo.buildNumber} BAMBO_BRANCH=${bamboo.repository.branch.name} CODECOV_TOKEN=xxxxxx-xxxxxx-xxxxxx-xxxxx node node_modules/codecov.io/bin/codecov.io.js < ./test/coverage/lcov.info
It's awesome that I can use a simple API to get the current report, but I'd love to be able to get historical data as well. I don't need full reports from the past, just the coverage, and if possible, the total counts for past commits.
My primary use case is to build a customized graph of the data. Not that the graphs provided on the branch.svg endpoint aren't nice, but they aren't =). More importantly, I want to be able to combine this data with other data I'm collecting out of band, like who is making the commits, how busy development is, etc.
$ cat coverage/lcov.info | CODECOV_TOKEN="xxxxxxxx-xxxx-xxxx-xxxx-xxxx" codecov
I know partial line coverage is still a WIP but I figured I'd highlight a false positive.
It's the only one I've hit so far.
See the report. The issue is with:
if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) {
both conditions are hit via the unit tests.
Here are the environment variables: https://docs.snap-ci.com/environment-variables/
I may try my hand at a PR if I get the time :-)
right now, it has an exit code of 0
, so my tests do not fail. this might be intentional, but i prefer if it failed (at least if the server isn't down)
./node_modules/.bin/codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v1.0.1
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{ service: 'circleci',
build: '145.0',
job: '145.0',
commit: '65dee33673219254c83ad6720f0b32a0f7845865',
branch: 'codecov',
pr: undefined,
slug: 'jonathanong/server',
package: 'node-v1.0.1' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
$ find . -type f -name '*.gcno' -exec gcov {} +
==> Scanning for reports
+ ./coverage/lcov.info
==> Uploading reports
HTTP 400
Please provide the repository token to upload reports via `-t :repository-token`
when travis shows total coverage 74%, codecov.io shows only 66.63%.
I would wish to let a custom account comment on my pull requests, preferably signed in through an oAuth token. No priority, but would be a neat feature.
I'm trying to simply use this library to post coverage from a private repo to codecov in CircleCI however the codecov api is returning a 400 when running cat ./coverage/lcov.info | ./node_modules/.bin/codecov
. I've already generated the lcov data before trying to post to codecov. The API seems to be rejecting the request because the service name is not a valid value:
{ statusCode: 400,
body: '{"meta": {"status": 400, "request": "7c537964-75a9-46f7-9f3c-3e12dfc598d8"}, "uploaded": false, "message": "Invalid value \'circle\' (str): must be ci-provider (at service)"}',
request:
{ url: 'https://codecov.io/upload/v2?service=circle&build=10&commit=COMMIT&branch=feature%2Fcodecov&pull_request=&owner=OWNER&repo=REPO&token=TOKEN&package=node',
body: 'TN:\nSF:app/js/config/config.js\nFNF:0\nFNH:0\nDA:1,1\nLF:1\nLH:1\nBRF:0\nBRH:0\nend_of_record\nTN:\nSF:app/js/app.js\nFN:17,(anonymous_1)\nFNF:1\nFNH:0\nFNDA:0,(anonymous_1)\nDA:7,1\nDA:18,0\nLF:2\nLH:1\nBRF:0\nBRH:0\nend_of_record\n' } } } Error: non-success response
at Request._callback (/home/ubuntu/REPO/node_modules/codecov.io/lib/sendToCodeCov.io.js:30:19)
at Request.self.callback (/home/ubuntu/REPO/node_modules/codecov.io/node_modules/request/request.js:236:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/home/ubuntu/REPO/node_modules/codecov.io/node_modules/request/request.js:1142:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/home/ubuntu/REPO/node_modules/codecov.io/node_modules/request/request.js:1096:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)
detail: { statusCode: 400,
body: '{"meta": {"status": 400, "request": "7c537964-75a9-46f7-9f3c-3e12dfc598d8"}, "uploaded": false, "message": "Invalid value \'circle\' (str): must be ci-provider (at service)"}',
request:
{ url: 'https://codecov.io/upload/v2?service=circle&build=10&commit=COMMIT&branch=feature%2Fcodecov&pull_request=&owner=OWNER&repo=REPO&token=TOKEN&package=node',
body: 'TN:\nSF:app/js/config/config.js\nFNF:0\nFNH:0\nDA:1,1\nLF:1\nLH:1\nBRF:0\nBRH:0\nend_of_record\nTN:\nSF:app/js/app.js\nFN:17,(anonymous_1)\nFNF:1\nFNH:0\nFNDA:0,(anonymous_1)\nDA:7,1\nDA:18,0\nLF:2\nLH:1\nBRF:0\nBRH:0\nend_of_record\n' } }
Could this simply be a configuration error with the service name being sent where the service name should be circleci
instead of circle
? I couldn't find any documentation on this in the codecov api docs.
Note I've replaced some of the values of the request as this is a private repo
This is breaking node-tap.
https://github.com/cainus/codecov.io/blob/master/package.json#L29
Thanks!
๐ I want to raise the issue of whether or not this repository should be archived. A deprecation warning has been up since 2016.
In the last seven or so years, Codecov have changed its upload functionality heavily, and will continue to do so, further rendering this project inoperable against Codecov.
Additionally, this package itself beings in dependencies that contain vulns or other issues, such as #39.
Codecov has moved on to a node based uploader: https://github.com/codecov/uploader that we ship as a binary for consumption in the CI.
The codecov.io
npm package still receives nearly 5,000 downloads per week.
Given that this repository hasn't been updated in quite some time, I believe it's best that we archive or delete this repo and stop offering it as an npm package. We could update the readme to point users who stumble upon this repo to newer solutions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.