Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codecov

Package Overview
Dependencies
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codecov - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

appveyor.yml

110

lib/codecov.js

@@ -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--) {

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc