connected-information-systems / diff-test-coverage Goto Github PK
View Code? Open in Web Editor NEWA Node.js commandline tool which filters test coverage based on a (source control) diff.
License: MIT License
A Node.js commandline tool which filters test coverage based on a (source control) diff.
License: MIT License
I am running this command:
$ git diff develop...feature/optimistic-ui | diff-test-coverage -c coverage/clover.xml -t lcov
I'm getting the following error:
Not enough non-option arguments: got 0, need at least 1
Any ideas?
The following packages are using a version of minimist
that contains a vulnerability:
cobertura-parse
golang-cover-parse
jacoco-parse
These packages aren't maintained anymore so I'm not sure how to proceed. If there's anything I can do to help let me know.
Trying to get it to work with lcov and jest tests. Here's my command and result:
git diff develop...feature/update-mentions | diff-test-coverage -c coverage/clover.xml -t lcov --
An unexpected error occurred: Error: Failed to parse string
at maybeWrapAsError (/Users/karl/.nvm/versions/node/v10.16.3/lib/node_modules/@connectis/diff-test-coverage/node_modules/bluebird/js/release/util.js:61:12)
at /Users/karl/.nvm/versions/node/v10.16.3/lib/node_modules/@connectis/diff-test-coverage/node_modules/bluebird/js/release/nodeback.js:38:50
at walkFile (/Users/karl/.nvm/versions/node/v10.16.3/lib/node_modules/@connectis/diff-test-coverage/node_modules/lcov-parse/lib/index.js:108:9)
at /Users/karl/.nvm/versions/node/v10.16.3/lib/node_modules/@connectis/diff-test-coverage/node_modules/lcov-parse/lib/index.js:118:13
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
Using template coverage-lines-line
causes the following error.
All other templates are working for me.
git diff origin/master...HEAD | diff-test-coverage -c coverage/lcov.info -t lcov --log-template coverage-lines-line --
An unexpected error occurred: TypeError: Cannot read property 'toString' of undefined
at _.find.detail (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/lib/console-reporter.js:126:73)
at baseFindIndex (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:802:11)
at findIndex (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:7258:14)
at Function.find (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:5059:21)
at isLineCovered (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/lib/console-reporter.js:126:29)
at displayLineCoverageLine (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/lib/console-reporter.js:95:23)
at Object.displayLineCoverageLine (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/lib/console-reporter.js:62:29)
at _.forEach (lodash.templateSources[0]:18:10)
at /Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:4905:15
at baseForOwn (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:2990:24)
at /Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:4874:18
at Function.forEach (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:9342:14)
at _.forEach (lodash.templateSources[0]:16:4)
at /Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:4905:15
at baseForOwn (/Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:2990:24)
at /Users/home/.nvm/versions/node/v10.18.1/lib/node_modules/@connectis/diff-test-coverage/node_modules/lodash/lodash.js:4874:18
diff-test-coverage/lib/console-reporter.js
Line 126 in a1db576
When I log out the value of coverageDetails
, I get a string from the my git diff:
import { lstatSync, readdirSync, readFileSync } from "fs";
.
The issue seems to be that this line is passing a previousLineNumber
arg
displayLineCoverageLine
is not expecting that arg.This error is ocurring while parsing a cobertura.xml file.
I'm using the following command to get the coverage diff:
git diff develop...HEAD | diff-test-coverage -c coverage/cobertura-coverage.xml -t cobertura --
lcov file doesn't work, I get the "No coverage information found for any of the new lines in the diff." message.
git diff develop...HEAD | diff-test-coverage -c coverage/lcov.info -t lcov --
Is there anything wrong with my setup ?
PS: I already tried to increase the node max memory, but still the same error
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.