GithubHelp home page GithubHelp logo

codecov / codecov-node Goto Github PK

View Code? Open in Web Editor NEW
292.0 14.0 163.0 1.5 MB

Global coverage report uploader for Codecov in NodeJS

Home Page: https://codecov.io

License: MIT License

JavaScript 100.00%
codecov coverage node

codecov-node's People

Contributors

aiell0 avatar dependabot-preview[bot] avatar dependabot[bot] avatar dotnetcarpenter avatar drazisil avatar drazisil-codecov avatar dtinth avatar eddiemoore avatar fabiendem avatar fossabot avatar hellatan avatar iansu avatar ibrahim0814 avatar jonathanong avatar mightyiam avatar radagaisus avatar ralic avatar robocafaz avatar rochdev avatar ryanlntn avatar simov avatar sn1020 avatar snyk-bot avatar stevepeak avatar sy-hash avatar thedancingcode avatar thomasrockhu avatar thomasrockhu-codecov avatar victorhqc avatar yhatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codecov-node's Issues

Not compatible on node 0.12 because of `request`

I'm getting issues uploading coverage data from node 0.12 because the package depends on a version of request that isn't compatible with that engine. here is the error:

$ npm run codecov
> [email protected] codecov /home/travis/build/slackapi/hubot-slack
> codecov
/home/travis/build/slackapi/hubot-slack/node_modules/codecov/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/travis/build/slackapi/hubot-slack/node_modules/codecov/node_modules/request/node_modules/hawk/lib/index.js:5:33)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

commit: true (HTTP 400) when running with option -c on CircleCI

I run into a problem that when I put into the CircleCI build configuration

./packages/core/node_modules/.bin/codecov -c -F unittests

I receive the following output in the console:

  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v2.2.0
==> Detecting CI Provider
    Circle CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{ service: 'circleci',
  build: '8.0',
  job: '8.0',
  commit: 'true',
  branch: '10003-setup-core-application',
  pr: undefined,
  slug: '<correct repo slug>',
  flags: 'unittests',
  token: '<correct token>',
  package: 'node-v2.2.0' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find . -type f -name '*.gcno'  -exec gcov  {} +
==> Scanning for reports
    + ./packages/core/coverage/clover.xml
    + ./packages/core/coverage/lcov.info
==> Uploading reports
    HTTP 400
commit must match pattern ^\d+:\w{12}|\w{40}$

note, that commit has a true value instead SHA hash.
When I remove the -c option (removing coverage report after upload) from the command, the coverage is uploaded succesfully (the commit property has a correct value)
The problem occurs on both 2.2.0 and 2.3.0 versions of codecov-node.

Coverage report upload failing on appveyor with v2.2.0

Here is the command ran:

.\node_modules\.bin\istanbul cover .\node_modules\mocha\bin\_mocha  -- --reporter lcovonly --ui bdd -R spec -t 5000 tests\unit

The output:

=============================================================================
Writing coverage object [C:\projects\cross-browser-tests-runner\coverage\coverage.json]
Writing coverage reports at [C:\projects\cross-browser-tests-runner\coverage]
=============================================================================
=============================== Coverage summary ===============================
Statements   : 99.21% ( 501/505 )
Branches     : 89.83% ( 159/177 )
Functions    : 99.15% ( 116/117 )
Lines        : 99.21% ( 500/504 )
================================================================================
.\node_modules\.bin\codecov
  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v2.2.0
==> Detecting CI Provider
    AppVeyor CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{ service: 'appveyor',
  commit: '9f8c9ac60e2e08491d5a6a533335bbfebb76cf1b',
  branch: 'master',
  pr: undefined,
  job: 'reeteshranjan/cross-browser-tests-runner/1.0.47',
  build: '8dkkhy310n3fteu4',
  slug: 'reeteshranjan/cross-browser-tests-runner',
  token: '6ddf3961-0a50-4816-bf4c-e0cfb5f3a922',
  package: 'node-v2.2.0' }
==> 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:524
    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:481:13)
    at execSync (child_process.js:521:13)
    at Object.upload (C:\projects\cross-browser-tests-runner\node_modules\codecov\lib\codecov.js:264:18)
    at Object.<anonymous> (C:\projects\cross-browser-tests-runner\node_modules\codecov\bin\codecov:26:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
Command exited with code 1

What am I doing wrong here?

Linux build on circlci and OSX build on travis have been working fine for last one week or so across several builds already created.

The appveyor build url: https://ci.appveyor.com/project/reeteshranjan/cross-browser-tests-runner/build/1.0.47

appveyor.yml url: https://github.com/reeteshranjan/cross-browser-tests-runner/blob/master/appveyor.yml

Jest coverage - help

Hi all,

I am using Jest for testing

my codecov set

// in package.json
...
"scripts": {
 "test": "jest"
...
// .tavis.yml
language: node_js
node_js:
- stable
cache:
  directories:
  - node_modules
after_success:
  - ./bin/codecov -e TRAVIS_NODE_VERSION

i could not tigger codecov

cache.1
Setting up build cache
$ export CASHER_DIR=$HOME/.casher
0.05s$ Installing caching utilities
0.00s
0.98sattempting to download cache archive
fetching codecov/cache--node-stable.tgz
fetching codecov/cache--node-stable.tbz
fetching master/cache--node-stable.tgz
found cache
0.00s
1.83sadding /home/travis/build/seeliang/react-range-selector/node_modules to cache
$ node --version
v5.8.0
$ npm --version
3.7.3
$ nvm --version
0.23.3
install
11.01s$ npm install 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
> [email protected] install /home/travis/build/seeliang/react-range-selector/node_modules/execSync
> node install.js
[execsync v1.0.2] Attempting to compile native extensions.
[execSync v1.0.2]
    Native code compile failed!!
[email protected] /home/travis/build/seeliang/react-range-selector
└─┬ [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   └─┬ [email protected] 
  │     └── [email protected] 
  └── [email protected] 
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
3.91s$ npm test
> [email protected] test /home/travis/build/seeliang/react-range-selector
> jest
Using Jest CLI v0.10.0, jasmine2, babel-jest
 PASS  assets/js/__tests__/input-checkbox__test.js (0.865s)
1 test passed (1 total in 1 test suite, run time 1.837s)
The command "npm test" exited with 0.
cache.2
store build cache
0.00s
5.05schange detected:
/home/travis/build/seeliang/react-range-selector/node_modules/argv/build/full.sh
/home/travis/build/seeliang/react-range-selector/node_modules/argv/build/lint.js
/home/travis/build/seeliang/react-range-selector/node_modules/argv/build/test.js
/home/travis/build/seeliang/react-range-selector/node_modules/argv/CHANGELOG.md
/home/travis/build/seeliang/react-range-selector/node_modules/argv/index.js
/home/travis/build/seeliang/react-range-selector/node_modules/argv/lib/argv.js
/home/travis/build/seeliang/react-range-selector/node_modules/argv/LICENSE
/home/travis/build/seeliang/react-range-selector/node_modules/argv/Makefile
/home/travis/build/seeliang/react-range-selector/node_modules/argv/.nodelint.json
/home/travis/build/seeliang/react-range-selector/node_modules/argv/.npmignore
/home/travis/build/seeliang/react-range-selector/node_modules/argv/package.json
/home/travis/build/seeliang/react-range-selector/node_modules/argv/README.md
/home/travis/build/seeliang/react-range-selector/node_m
...
changes detected, packing new archive
uploading archive
after_success
0.00s$ ./bin/codecov -e TRAVIS_NODE_VERSION
/home/travis/build.sh: line 45: ./bin/codecov: No such file or directory
Done. Your build exited with 0.

many thanks

let's update "request" to latest

Hi guys,

Currently, npm shows deprecation message upon installing:
screen shot 2017-10-14 at 15 08 56

This is because we're not using the latest request - current-one uses [email protected] which has been dropped on latest request since (what solves the issue).

I know there was some action happening on #72, but let's check and update the deps; this will have to be done some time anyway.

cheers

graceful-fs version deprecated used in rimraf

npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible.

Looks like rimraf is using a very crusty version of graceful-fs
isaacs/rimraf#32

I and many others are using node 7. Can you use an alternative to rimraf, force it not to use graceful-fs, or use another package that doesn't depend on this deprecated package.

Yea I know codecov is just a dev dependency but would prefer not to use packages with such dated dependencies especially when alternatives exist.

npm ls graceful-fs
[email protected] 
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ [email protected]
        └── [email protected]

Runtime error when offline

When offline sendToCodecovV2 will throw Uncaught TypeError: Cannot read property 'statusCode' of undefined.

I have a patch that fixes it.

No CI detected

node v7+, npm v4+, codecov v1.0.x

 ✔ should transpile to .dest, using Buble
----------|----------|----------|----------|----------|----------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files |      100 |      100 |      100 |      100 |                |
 index.js |      100 |      100 |      100 |      100 |                |
----------|----------|----------|----------|----------|----------------|
  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v1.0.1
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: 'b31e787713c11c14343215b14a50419ef68f2265',
  branch: 'master',
  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
    + ./coverage.lcov
==> Uploading reports
    HTTP 400
Please provide the repository token to upload reports via `-t :repository-token`

~/code/start-rollup master ✓ ✗  
% ❯ 

When provide a token it works. The question is why it wants me a token when I have both travis and appveyor on that repo. Remove that note from the readmes if token is required.

Upload not reading token from `.codecov.yml` nor `codecov.yml`

When I tried running $ codecov in the root directory of the repository, I'm getting the following output:

  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v2.2.0
YAML .codecov.yml
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: 'eb22cc3fcb7c17222366ed11b57ea5a1049fd7c2',
  branch: 'master',
  package: 'node-v2.2.0' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find . -type f -name '*.gcno'  -exec gcov  {} +
==> Scanning for reports
    + ./foo/coverage/lcov.info
==> Uploading reports
    HTTP 400
Please provide the repository token to upload reports via `-t :repository-token`

even though there's a token in my .codecov.yml. I did verify that the .codecov.yml is valid by running:

$ cat .codecov.yml | curl --data-binary @- https://codecov.io/validate

Upon digging into the code, I see these lines detect the codecov.yml file but don't do anything with it.

I can put the token in process.env.CODECOV_TOKEN but I'm just wondering if it's a mistake or by design that reading the token from the codecov.yml file isn't supported.

Github Badge sizing is slightly off

Compare codecov.io's badge to img.shield.io's badge:

codecov.io: Code Coverage
img.shield.io: Code Coverage

I know this is very low priority, but it's an aesthetic that I think should be fixed. Would it be possible to mimic img.shields.io's SVG generation algorithm somehow?

I'm guessing the issue is caused by having implemented the badge with only 2-digit percentages in mind.

Automatic report discovery failing on Windows environment.

When trying to discover reports automatically on AppVeyor I get the following error on the FIND command:

FIND: Parameter format not correct
child_process.js:1389
    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:1346:13)
    at execSync (child_process.js:1386:13)
    at Object.upload (C:\projects\test-codecov\node_modules\codecov\lib\codecov.js:260:18)
    at Object.<anonymous> (C:\projects\test-codecov\node_modules\codecov\bin\codecov:24:9)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

See complete build log here.

AppVeyor runs in a Windows environment and I can see in the source that the module uses cat and the syntax of find is *nix style. Is this testet on a Windows environment?
I have not been able to get the windows shell to find any files with the syntax used in the search of reports.

Flags not working - set to '#true'

I'm trying to use flags for different type of tags.
but only see a #true flag set. is this a bug, or do I misunderstand something? is a codecov.yml required?

  • the build installs codecov 3.0.0
  • codecov --clear --flags unittests
  • I see no traces of ' flags' being set in the codecov built output
  • In the pr report, the only flag I see is '#true' (lenntt/kinglouie#9)
  • everything else seems fine - coverage being uploaded

https://codecov.io/gh/lenntt/kinglouie/commit/386413080cd4dbc668a531755cb5c9bfcf41287b/build

this is my .travis.yml:

language: node_js
node_js:
  - "stable"

install:
  - npm install
  - npm install -g codecov

script:
  - npm run lint
  - nyc --reporter=lcov mocha --recursive test/unit
  - codecov --clear --flags unittests
  - nyc --reporter=lcov mocha --recursive test/system
  - codecov --clear --flags systemtests

Getting no-reports-generated error

When I'm uploading reports to codecov, I face a problem. It seems that codecov doesn't see the report:

2016-10-20T23:00:18+03:00 seterror  GET /repos/octet-stream/then-busboy/commits/95e7d53463011661d1d7b7a444db684602d8d842/statuses bot=octet-stream code=200     
2016-10-20T23:00:18+03:00 notify  skip-no-files-found  error=Error   
2016-10-20T23:00:18+03:00 notify  GET /repos/octet-stream/then-busboy/commits/95e7d53463011661d1d7b7a444db684602d8d842/statuses bot=octet-stream code=200     
2016-10-20T22:59:53+03:00 upload  no-reports-generated  error=Error   
2016-10-20T22:59:53+03:00 upload  Processed file name=lcov.info language=lcov   
2016-10-20T22:59:53+03:00 upload  Upload archived download   
2016-10-20T22:59:47+03:00 upload  

Even though, report files exist and are attached:

==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: '9207932354730daa0fdad63aba691ac566cc72f8',
  branch: 'master-upstream',
  token: '*TOKEN*',
  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
    + ./coverage/lcov.info
==> Uploading reports
    Success!
    View report at: https://codecov.io/github/octet-stream/then-busboy/commit/9207932354730daa0fdad63aba691ac566cc72f8

ls -la ./coverage
total 8
drwxr-xr-x   4 diedsmiling  staff   136 Oct 20 21:51 .
drwxr-xr-x  27 diedsmiling  staff   918 Oct 20 23:09 ..
drwxr-xr-x  10 diedsmiling  staff   340 Oct 20 21:51 lcov-report
-rw-r--r--   1 diedsmiling  staff  3988 Oct 20 23:08 lcov.info

Reports are generated with nyc for code coverage and reports, and my codecov command looks like

npm run cover && ./node_modules/nyc/bin/nyc.js report --reporter=lcov npm run test > coverage.lcov && ./node_modules/codecov/bin/codecov -t *TOKEN*

What am I doing wrong?

Issues with execsync prevent codecov from installing correctly

Realizing this is an issue of one of your dependencies, I did decide to post it here. After all, I am not interested in your dependency, but in your project.

On Ubuntu 14.04 (vagrant box), the system hangs when compiling native extensions. No errors thrown, no exit code, it just hangs until you manually stop it:

npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb rebuildBundles [ 'temp' ]
npm info install [email protected]
npm info postinstall [email protected]
npm verb readDependencies loading dependencies from /home/vagrant/<<company>>/node_modules/codecov/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json
npm verb readDependencies loading dependencies from /home/vagrant/<<company>>/node_modules/codecov/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json

> [email protected] install /home/vagrant/<<company>>/node_modules/codecov/node_modules/execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.

On OS X Yosemite, it works... at least it doesn't throw around exit codes, but it still logs a failure:


npm install --save-dev codecov

> [email protected] install /Users/stephanbijzitter/<<company>>/node_modules/codecov/node_modules/execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.
[execSync v1.0.2]
    Native code compile failed!!
[email protected] node_modules/codecov
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])

Running node 0.12.5

Add support for Jenkins Blue Ocean

Blue Ocean supports pull requests directly and uses a new version of the SCM plugin. This new version has changed the following environment variables used by codecov:

GIT_BRANCH has been replaced with BRANCH_NAME
GIT_COMMIT has no direct replacement (accessible only with Groovy)

SInce Blue Ocean no longer uses the GitHub Pull Request Builder plugin, all ghprb prefixed variables are not longer defined either, so:

ghrpbSourceBranch has been replaced with BRANCH_NAME
ghrpbActualCommit has no direct replacement (accessible only with Groovy)
ghprbPullId has been replaced with CHANGE_ID

The other environment variables are still available as before.

Here is a working Groovy implementation from the Docker team:
https://github.com/docker/jenkins-pipeline-scripts/blob/master/vars/codecov.groovy

References:
https://jenkins.io/projects/blueocean/
https://jenkins.io/doc/book/pipeline/multibranch/#additional-environment-variables

fatal: Not a git repository

I am getting an error from the current version of this in one of the repos we are using it in.


 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v3.0.0
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
fatal: Not a git repository (or any of the parent directories): .git
/bin/sh: hg: not found
child_process.js:635
    throw err;
    ^
Error: Command failed: git rev-parse --abbrev-ref HEAD || hg branch
fatal: Not a git repository (or any of the parent directories): .git
/bin/sh: hg: not found
    at checkExecSyncError (child_process.js:592:13)
    at execSync (child_process.js:632:13)
    at Object.branch ([redacted]/node_modules/codecov/lib/git.js:6:12)
    at Object.configuration ([redacted]/node_modules/codecov/lib/services/localGit.js:7:22)
    at detectProvider ([redacted]/node_modules/codecov/lib/detect.js:25:20)
    at Object.upload ([redacted]/node_modules/codecov/lib/codecov.js:229:13)
    at Object.<anonymous> ([redacted]/node_modules/codecov/bin/codecov:26:9)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

I am not sure if it is related to #1 or not. This happens on travis-ci run for a private repo.
Its inside a docker container
node v8.9.4 (npm v5.6.0)
Docker version 17.06.0-ce, build 02c1d87

FIND: Parameter format not correct

I'm trying to get Codecov working for my application, but every time I try to run it I get as far as ==> Scanning for reports and then it throws the following error:

FIND: Parameter format not correct
child_process.js:526
    throw err;
    ^

Error: Command failed: find F:\app -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:483:13)
    at execSync (child_process.js:523:13)
    at Object.upload (F:\app\node_modules\codecov\lib\codecov.js:260:18)
    at Object.<anonymous> (F:\app\node_modules\codecov\bin\codecov:24:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

I'm using the latest (afaik) v1.0.1 installed from npm just now.

Title output in log has wrong version

When running codecov on version 2.0.1 the terminal output specifies version 1.0.1.

> codecov

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                                v1.0.1

dependency issue, execSync ultimately relies on graceful-fs @ 1.2.3 which may break with node 7

Dep graph looks like this:
[email protected] > [email protected] > [email protected] > [email protected] > [email protected]

It appears that execSync @ 1.0.2 is the latest version and it has these old deps.

I wonder if you could use cross-spawn @ 4.0.0 instead? If you need output from your spawned command you might find shelljs interesting (0.5.3 works with node 0.10, if you don't mind losing support for older versions of node, you could look at the latest 0.7.0.)

Spaces in directory names aren't supported

 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v1.0.1
==> Detecting CI Provider
    Jenkins CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{ service: 'jenkins',
  commit: '862ef1adb798c3ee619bed7e04f4e14fe272f539',
  branch: 'origin/pr/534/head',
  build: '2497',
  build_url: 'http://jenkins.lion.enigma/job/LION%20-%20PR%20-%201%20-%20UNIT/2497/',
  root: '/var/lib/jenkins/workspace/LION - PR - 1 - UNIT',
  pr: undefined,
  token: '****',
  package: 'node-v1.0.1' }
==> Building file structure
/bin/sh: 1: cd: can't cd to /var/lib/jenkins/workspace/LION
/bin/sh: 1: hg: not found
child_process.js:526
    throw err;
    ^

Error: Command failed: cd /var/lib/jenkins/workspace/LION - PR - 1 - UNIT && git ls-files || hg locate
/bin/sh: 1: cd: can't cd to /var/lib/jenkins/workspace/LION
/bin/sh: 1: hg: not found

    at checkExecSyncError (child_process.js:483:13)
    at execSync (child_process.js:523:13)
    at Object.upload (/var/lib/jenkins/workspace/LION - PR - 1 - UNIT/node_modules/codecov/lib/codecov.js:215:13)
    at Object.<anonymous> (/var/lib/jenkins/workspace/LION - PR - 1 - UNIT/node_modules/codecov/bin/codecov:24:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
Build step 'Execute shell' marked build as failure

No CI Detected for repo using Travis CI

Any idea why codecov isn't working with a repo using Travis CI? There's a .travis.yml in root and Travis is working fine on commits. Tests are run using Lab into coverage/lcov.info.

==> Detecting CI Provider
    No CI Detected. Using git/mercurial

codecov-node doesn't accept piped report

Currently you can not pipe a report to codecov. E.g. tap --coverage-report=text-lcov | codecov --disable=gcov where the lcov report comes from tap.

I have a patch that enable support for piping reports but I want to see if #28 is merged before cleaning up the patch and write proper test.

Command for setup on the website is wrong

For the lack of a better place to report this: the command in the setup guide (on the actual website) for javascript is wrong.

istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec \
  && ./node_modules/codecov.io/bin/codecov

istanbul cover jasmine-node --captureExceptions spec/ \
  && /node_modules/codecov.io/bin/codecov

The actual command is ./node_modules/.bin/codecov, as described in this repo

Add ESLint or something

Here's a sample .eslintrc file, which found about 13 issues:

extends:
  - eslint:recommended

env:
  mocha: true
  node: true

globals:
  expect: false

rules:
  no-console: 0
  no-unused-vars: [2, {vars: all, args: none}]
  quotes: [0, single]

NOTE: I disabled the quotes rule because it seems like we mix singles and doubles (pretty easy to auto-fix):

✖ 221 problems (13 errors, 208 warnings) "quotes": [1, single]
✖ 408 problems (13 errors, 395 warnings) "quotes": [1, double]

Output:

$ eslint .

/Users/pdehaan/dev/tmp/del/codecov-node/lib/codecov.js
  8:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/lib/services/circle.js
  16:93  error  Unexpected trailing comma  comma-dangle

/Users/pdehaan/dev/tmp/del/codecov-node/lib/services/drone.js
  4:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/lib/services/localGit.js
  4:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/lib/services/snap.js
  14:47  error  Unexpected trailing comma  comma-dangle

/Users/pdehaan/dev/tmp/del/codecov-node/test/detect.js
  6:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/test/index.js
   6:7   error  'execSync' is already defined  no-redeclare
  16:17  error  Empty block statement          no-empty
  22:17  error  Empty block statement          no-empty

/Users/pdehaan/dev/tmp/del/codecov-node/test/services/drone.js
  5:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/test/services/localGit.js
  5:7  error  'execSync' is already defined  no-redeclare

/Users/pdehaan/dev/tmp/del/codecov-node/test/upload.js
  1:5  error  'fs' is defined but never used  no-unused-vars
  6:7  error  'execSync' is already defined   no-redeclare

✖ 13 problems (13 errors, 0 warnings)

How to work with mocha-phantomjs

It is my scripts

  "scripts": {
    "test": "./node_modules/.bin/mocha-phantomjs -p /usr/local/bin/phantomjs test/index.html",
  }

.travis.yml

  language: node_js
  node_js: 5
  install:
    - npm install
  script:
    - npm test
    - codecov

But there was an error:

2017-03-07T17:02:32+08:00 upload  no-reports-generated  error=Error   
  2017-03-07T17:02:32+08:00 upload  Upload archived download   
  2017-03-07T17:02:32+08:00 upload  GET /search/issues?q=0dcc7e65f97c2caaf6c78677f398ff411ff25884+repo:bigggge%2FgQuery+type:pr+state:open bot=bigggge code=200  ratelimit=29/30 reset=1488877412     
  2017-03-07T17:02:32+08:00 upload  GET /repos/bigggge/gQuery/commits/0dcc7e65f97c2caaf6c78677f398ff411ff25884 bot=bigggge code=200     
  2017-03-07T17:02:31+08:00 upload  GET /repos/bigggge/gQuery/contents/codecov.yml bot=bigggge code=200     
  2017-03-07T17:02:22+08:00  Upload accepted ci=travis build=11.1   

Bug: Incorrect paths when reporting from AppVeyor

I've run into an issue with the paths being reported incorrectly. Example of the repository:
/src
/projectA
/AppA.js
/projectB
/AppB.js

I ran the tests separately for each project and uploaded results of each test run to codecov. The trouble was that the files were reported without the path, the script just used the current working directory as the root so in the report I saw AppA.js and AppB.js next to each other. This doesn't happen with the bash uploader.

I went through the code and I think there's a bug in the Appveyor service - the root property is not set in on the options (https://github.com/codecov/codecov-node/blob/master/lib/services/appveyor.js) AppVeyor provides an environment variable for the repository which you should be able to use: APPVEYOR_BUILD_FOLDER

Consider switching to nyc from istanbul

nyc is much easier to work with and since istanbul seems not to be maintained anymore (by the time I'm writing this it's been 7 months without a single commit) it seems prudent to do so.

With nyc the test script will look like this:

    "test": "nyc mocha"

Simple as that.

Repo token was required for open source repo in circle ci

It's not a critical issue because a workaround is available, but I think this isn't a supposed behaviour.

I built my open source repo kt3k/ScenarioScript in circle ci and tried to send coverage data using codecov module.
But it failed and showed this error:

==> Uploading reports
    HTTP 400
Please provide the repository token to upload reports via `-t :repository-token`

https://circleci.com/gh/kt3k/ScenarioScript/2
https://circleci.com/gh/kt3k/ScenarioScript/3
https://circleci.com/gh/kt3k/ScenarioScript/4

(I retried 2 times, but those didn't make difference.)

When I supplied CODECOV_TOKEN env variable, it succeeded.

https://circleci.com/gh/kt3k/ScenarioScript/6

I think this is supposed to work without repo token.

How to combine multiple reports?

Run each test

# test - 1
$ yarn test:foo

# test - 2
$ yarn test:bar

All reports

coverage
  - foo
    - lcov.info
    - ...
  - bar
    - lcov.info
    - ...

Then how do I combine these reports into one?

Getting "X Failed to read file at " when using Circleci v2.0

I'm running the ./node_modules/.bin/codecov command as the last step of my build job. And as part of the result i get this message:

==> Generating gcov reports (skip via --disable=gcov)
    $ find /home/circleci/repo -type f -name '*.gcno'  -exec gcov  {} +
==> Scanning for reports
    X Failed to read file at 

The result is a successful upload to codecov, but the coverage report is corrupted.
Codecov claims There was an error processing coverage reports. and that there were No files found in report..

I'm running my tests with this mocha command: mocha --recursive -r ts-node/register test/**/*.ts

Versions:

  • codecov-node: v2.3.0
  • node: 7.10
  • circleci: 2.0
  • mocha: 3.5.3

Partial coverage documentation is unclear

On the documentation webage, it says:

# only upload the coverage.json file
bash <(curl -s https://codecov.io/bash) -f coverage/coverage.json

However, the Node documentation (such as it is) doesn't even suggest using the bash-uploader; it suggests this module.

Although -f exists, it's entirely undocumented, as far as I can tell; and to boot, there's no coverage/coverage.json by default with at least some of the tools?

For instance, I use nyc; there's a custom JSON file in .nyc_output — is that what's needed? Or should I be using the json reporter? (Which, by the way, doesn't output to STDOUT, so the instructions to redirect > coverage.json are unhelpful; turns out, it dumps the output to a file named coverage-final.json in your --report-dir.)

issue when uploading from bambo

error	19-Apr-2017 23:50:50	/opt/atlassian/bamboo/temp/BBM-VEB-JOB1-35-ScriptBuildTask-2100581653620210381.sh: line 1: syntax error near unexpected token `('
error	19-Apr-2017 23:50:50	/opt/atlassian/bamboo/temp/BBM-VEB-JOB1-35-ScriptBuildTask-2100581653620210381.sh: line 1: `bash <(curl -s https://codecov.io/bash) -t token
simple	19-Apr-2017 23:50:50	Failing task since return code of [/bin/sh /opt/atlassian/bamboo/temp/BBM-VEB-JOB1-35-ScriptBuildTask-2100581653620210381.sh] was 2 while expected 0

not sure why its failing.
OS: CentOS.

I copy pasted the script right off the documents page.

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.