Comparing version 2.2.0 to 2.3.0
@@ -11,3 +11,9 @@ var fs = require('fs'); | ||
var patterns = "-type f \\( -name '*coverage.*' " + | ||
var patterns, more_patterns = ''; | ||
var isWindows = process.platform.match(/win32/) || process.platform.match(/win64/) | ||
if(!isWindows) { | ||
patterns | ||
= "-type f \\( -name '*coverage.*' " + | ||
"-or -name 'nosetests.xml' " + | ||
@@ -70,5 +76,66 @@ "-or -name 'jacoco*.xml' " + | ||
"-not -path '*/conftest_*.c.gcov'"; | ||
} | ||
else { | ||
patterns | ||
= '/a-d /b /s *coverage.* ' + | ||
'/s nosetests.xml ' + | ||
'/s jacoco*.xml ' + | ||
'/s clover.xml ' + | ||
'/s report.xml ' + | ||
'/s cobertura.xml ' + | ||
'/s luacov.report.out ' + | ||
'/s lcov.info ' + | ||
'/s *.lcov ' + | ||
'/s gcov.info ' + | ||
'/s *.gcov ' + | ||
'/s *.lst' + | ||
'| findstr /i /v \\.sh$ ' + | ||
'| findstr /i /v \\.data$ ' + | ||
'| findstr /i /v \\.py$ ' + | ||
'| findstr /i /v \\.class$ ' + | ||
'| findstr /i /v \\.xcconfig$ ' + | ||
'| findstr /i /v Coverage\\.profdata$ ' + | ||
'| findstr /i /v phpunit-code-coverage\\.xml$ ' + | ||
'| findstr /i /v coverage\\.serialized$ ' + | ||
'| findstr /i /v \\.pyc$ ' + | ||
'| findstr /i /v \\.cfg$ ' + | ||
'| findstr /i /v \\.egg$ ' + | ||
'| findstr /i /v \\.whl$ ' + | ||
'| findstr /i /v \\.html$ ' + | ||
'| findstr /i /v \\.js$ ' + | ||
'| findstr /i /v \\.cpp$ ' + | ||
'| findstr /i /v coverage\\.jade$ ' + | ||
'| findstr /i /v include\\.lst$ ' + | ||
'| findstr /i /v inputFiles\\.lst$ ' + | ||
'| findstr /i /v createdFiles\\.lst$ ' + | ||
'| findstr /i /v coverage\\.html$ ' + | ||
'| findstr /i /v scoverage\\.measurements\\..* ' + | ||
'| findstr /i /v test_.*_coverage\\.txt ' + | ||
'| findstr /i /v \\vendor\\ ' + | ||
'| findstr /i /v \\htmlcov\\ ' + | ||
'| findstr /i /v \\home\\cainus\\ ' + | ||
'| findstr /i /v \\js\\generated\\coverage\\ ' + | ||
'| findstr /i /v \\virtualenv\\ ' + | ||
'| findstr /i /v \\virtualenvs\\ ' + | ||
'| findstr /i /v \\\\.virtualenv\\ ' + | ||
'| findstr /i /v \\\\.virtualenvs\\ ' + | ||
'| findstr /i /v \\\\.env\\ ' + | ||
'| findstr /i /v \\\\.envs\\ ' + | ||
'| findstr /i /v \\env\\ ' + | ||
'| findstr /i /v \\envs\\ ' + | ||
'| findstr /i /v \\\\.venv\\ ' + | ||
'| findstr /i /v \\\\.venvs\\ ' + | ||
'| findstr /i /v \\venv\\ ' + | ||
'| findstr /i /v \\venvs\\ ' + | ||
'| findstr /i /v \\\\.git\\ ' + | ||
'| findstr /i /v \\\\.hg\\ ' + | ||
'| findstr /i /v \\\\.tox\\ ' + | ||
'| findstr /i /v \\__pycache__\\ ' + | ||
'| findstr /i /v \\\\.egg-info* ' + | ||
'| findstr /i /v \\\\$bower_components\\ ' + | ||
'| findstr /i /v \\node_modules\\ ' + | ||
'| findstr /i /v \\conftest_.*\\.c\\.gcov '; | ||
} | ||
var sendToCodecovV2 = function(codecov_endpoint, query, upload_body, on_success, on_failure){ | ||
@@ -219,3 +286,3 @@ // Direct to Codecov | ||
// List git files | ||
var root = args.options.root || query.root || '.'; | ||
var root = path.resolve(args.options.root || query.root || '.'); | ||
console.log('==> Building file structure'); | ||
@@ -230,5 +297,16 @@ upload += execSync('cd '+root+' && git ls-files || hg locate').toString().trim() + '\n<<<<<< network\n'; | ||
if (gcg) { | ||
gcg = gcg.split(' ').map(function(p){return "-not -path '"+p+"'";}).join(' '); | ||
if(!isWindows) { | ||
gcg = gcg.split(' ').map(function(p){return "-not -path '"+p+"'";}).join(' '); | ||
} else { | ||
gcg = gcg.split(' ').map(function(p){return "^| findstr /i /v "+p;}).join(' '); | ||
} | ||
} | ||
var gcov = "find "+(args.options['gcov-root'] || root)+" -type f -name '*.gcno' "+gcg+" -exec "+(args.options['gcov-exec'] || 'gcov')+" "+(args.options['gcov-args'] || '')+" {} +"; | ||
var gcov; | ||
if(!isWindows) { | ||
gcov = "find "+(args.options['gcov-root'] || root)+" -type f -name '*.gcno' "+gcg+" -exec "+(args.options['gcov-exec'] || 'gcov')+" "+(args.options['gcov-args'] || '')+" {} +"; | ||
} else { | ||
// @TODO support for root | ||
// not straight forward due to nature of windows command dir | ||
gcov = "for /f \"delims=\" %g in ('dir /a-d /b /s *.gcno "+gcg+"') do "+(args.options['gcov-exec'] || 'gcov')+" "+(args.options['gcov-args'] || '')+" %g"; | ||
} | ||
debug.push(gcov); | ||
@@ -245,7 +323,16 @@ console.log(' $ '+gcov); | ||
// Detect .bowerrc | ||
var bowerrc = execSync('cd '+root+' && test -f .bowerrc && cat .bowerrc || echo ""').toString().trim(), more_patterns = ''; | ||
var bowerrc; | ||
if(!isWindows) { | ||
bowerrc = execSync('cd '+root+' && test -f .bowerrc && cat .bowerrc || echo ""').toString().trim(); | ||
} else { | ||
bowerrc = execSync('cd '+root+' && if exist .bowerrc type .bowerrc').toString().trim(); | ||
} | ||
if (bowerrc) { | ||
bowerrc = JSON.parse(bowerrc).directory; | ||
if (bowerrc) { | ||
more_patterns = " -not -path '*/" + bowerrc.toString().replace(/\/$/, '') + "/*'"; | ||
if(!isWindows) { | ||
more_patterns = " -not -path '*/" + bowerrc.toString().replace(/\/$/, '') + "/*'"; | ||
} else { | ||
more_patterns = '| findstr /i /v \\' + bowerrc.toString().replace(/\/$/, '') + '\\'; | ||
} | ||
} | ||
@@ -269,3 +356,10 @@ } | ||
console.log('==> Scanning for reports'); | ||
var _files = execSync('find ' + root + ' ' + patterns + more_patterns).toString().trim().split('\n'); | ||
var _files | ||
if(!isWindows) { | ||
_files = execSync('find ' + root + ' ' + patterns + more_patterns).toString().trim().split('\n'); | ||
} else { | ||
// @TODO support for a root directory | ||
// It's not straightforward due to the nature of the dir command | ||
_files = execSync('dir ' + patterns + more_patterns).toString().trim().split('\r\n'); | ||
} | ||
if (_files) { | ||
@@ -272,0 +366,0 @@ for (var i2 = _files.length - 1; i2 >= 0; i2--) { |
{ | ||
"name": "codecov", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Uploading report to Codecov: https://codecov.io", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"request": "2.79.0", | ||
"request": "2.81.0", | ||
"urlgrey": "0.4.4", | ||
@@ -35,0 +35,0 @@ "argv": "0.0.2" |
# Codecov NodeJS Uploader | ||
[![NPM version][npm-image]][npm-url] | ||
[![Build Status][travis-image]][travis-url] [![codecov.io](https://codecov.io/github/codecov/codecov-node/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-node?branch=master) | ||
[![Build Status][travis-image]][travis-url] | ||
[![Build Status][appveyor-image]][appveyor-url] | ||
[![codecov.io](https://codecov.io/github/codecov/codecov-node/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-node?branch=master) | ||
[![Dependency Status][depstat-image]][depstat-url] | ||
@@ -15,2 +17,6 @@ [![Dev Dependency Status][devdepstat-image]][devdepstat-url] | ||
``` | ||
or | ||
``` | ||
yarn add codecov --dev | ||
``` | ||
@@ -28,3 +34,3 @@ ## Usage: | ||
Repo tokens are neccessary to distinguish your repository from others. You can find your repo token on your repository page at Codecov. Set this unique uuid to `CODECOV_TOKEN` in your environment variables. | ||
Repo tokens are necessary to distinguish your repository from others. You can find your repo token on your repository page at Codecov. Set this unique uuid to `CODECOV_TOKEN` in your environment variables. | ||
@@ -63,2 +69,5 @@ ``` | ||
[appveyor-image]: https://ci.appveyor.com/api/projects/status/ea1suiv0tprnq61l?svg=true | ||
[appveyor-url]: https://ci.appveyor.com/project/eddiemoore/codecov-node/branch/master | ||
[npm-url]: https://npmjs.org/package/codecov | ||
@@ -86,1 +95,3 @@ [npm-image]: https://img.shields.io/npm/v/codecov.svg | ||
- v2.1.0 Flags supported http://docs.codecov.io/docs/flags | ||
- v2.2.0 Support for Jenkins Blue Ocean. Clean reports after upload. Fix for Gitlab. | ||
- v2.3.0 Added support for Windows. Updated dependencies. |
@@ -5,2 +5,4 @@ var fs = require('fs'); | ||
var isWindows = process.platform.match(/win32/) || process.platform.match(/win64/); | ||
var pathSeparator = !isWindows ? '/' : '\\'; | ||
@@ -21,2 +23,3 @@ describe("Codecov", function(){ | ||
it("can get a token passed via env variable", function(){ | ||
this.timeout(10000); | ||
process.env.codecov_token = 'abc123'; | ||
@@ -35,3 +38,3 @@ expect(codecov.upload({options: {dump: true}}).query.token).to.eql('abc123'); | ||
var res = codecov.upload({options: {dump: true}}); | ||
expect(res.files[0].split('/').pop()).to.eql('example.coverage.txt'); | ||
expect(res.files[0].split(pathSeparator).pop()).to.eql('example.coverage.txt'); | ||
expect(res.body).to.contain('this file is intentionally left blank'); | ||
@@ -41,4 +44,4 @@ }); | ||
it("can specify report in cli", function(){ | ||
var res = codecov.upload({options: {dump: true, file: 'test/example.coverage.txt'}}); | ||
expect(res.files[0].split('/').pop()).to.eql('example.coverage.txt'); | ||
var res = codecov.upload({options: {dump: true, file: 'test' + pathSeparator + 'example.coverage.txt'}}); | ||
expect(res.files[0].split(pathSeparator).pop()).to.eql('example.coverage.txt'); | ||
expect(res.body).to.contain('this file is intentionally left blank'); | ||
@@ -61,3 +64,3 @@ }); | ||
var res = codecov.upload({options: {dump: true}}); | ||
expect(res.files[0].split('/').pop()).to.eql('example.coverage.txt'); | ||
expect(res.files[0].split(pathSeparator).pop()).to.eql('example.coverage.txt'); | ||
expect(res.body).to.contain('this file is intentionally left blank'); | ||
@@ -130,3 +133,7 @@ }); | ||
'gcov-args': '-o'}}); | ||
expect(res.debug).to.contain('find folder/path -type f -name \'*.gcno\' -not -path \'ignore/this/folder\' -exec llvm-gcov -o {} +'); | ||
if(!isWindows) { | ||
expect(res.debug).to.contain('find folder/path -type f -name \'*.gcno\' -not -path \'ignore/this/folder\' -exec llvm-gcov -o {} +'); | ||
} else { | ||
expect(res.debug).to.contain('for /f "delims=" %g in (\'dir /a-d /b /s *.gcno ^| findstr /i /v ignore/this/folder\') do llvm-gcov -o %g'); | ||
} | ||
}); | ||
@@ -133,0 +140,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Telemetry
Supply chain riskThis package contains telemetry which tracks how it is used.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57017
48
1286
94
1
+ Addedajv@4.11.8(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedco@4.6.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhar-schema@1.0.5(transitive)
+ Addedhar-validator@4.2.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedjson-stable-stringify@1.1.1(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedperformance-now@0.2.0(transitive)
+ Addedqs@6.4.1(transitive)
+ Addedrequest@2.81.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedcaseless@0.11.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedgenerate-function@2.3.1(transitive)
- Removedgenerate-object-property@1.2.0(transitive)
- Removedhar-validator@2.0.6(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedis-my-ip-valid@1.0.1(transitive)
- Removedis-my-json-valid@2.20.6(transitive)
- Removedis-property@1.0.2(transitive)
- Removedjsonpointer@5.0.1(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedqs@6.3.3(transitive)
- Removedrequest@2.79.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtunnel-agent@0.4.3(transitive)
- Removedxtend@4.0.2(transitive)
Updatedrequest@2.81.0