Comments (17)
I would change it to c8 --reporter=lcov npm test && npx codecov
-- without any options codecov expects the coverage file to be in ./coverage/lcov.info
. With this reporter you get the html report and the codecov file that you need. You can take a look at the nyc instructions here: https://istanbuljs.github.io/nyc/setup-codecov
from c8.
@bcoe Same problem
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{ commit: '4830f0c24a845a6fbf8b4f5f32848c3be50811e0',
branch: 'circleci',
package: 'node-v3.3.0' }
==> Building file structure
==> 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
==> Uploading reports
Success!
View report at: https://codecov.io/github/zeit/tracing-js/commit/4830f0c24a845a6fbf8b4f5f32848c3be50811e0
Done in 10.34s.
from c8.
@styfle are you still having this problem? I believe I might have addressed it for our own use-cases at Google, I use this configuration:
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
"**/apis",
"**/benchmark",
"**/docs",
"**/samples",
"**/scripts",
"**/src/**/v*/**/*.js",
"**/test",
".jsdoc.js",
"**/.jsdoc.js",
"karma.conf.js",
"webpack-tests.config.js",
"webpack.config.js"
]
}
and run the codecov upload bin.
from c8.
It's working like a charm over here (private repo so I can't show the results).
Commands being run are:
c8 …run your tests… # We actually do this twice for two different test suites
c8 report --reporter=text-lcov > coverage/tests.lcov
codecov # it will discover lcov.info, as well as *.lcov files
from c8.
I have some projects using c8 + travis + codecov. However, it seems that the line number is wrong. Here is an example:
https://codecov.io/gh/eight04/idb-storage/src/master/index.js
from c8.
@eight04 @styfle this should work with codecov
, try using -reporter=text-lcov
for output? exactly the same as nyc.
from c8.
I have already used the text-lcov
format in travis. Log:
https://travis-ci.com/eight04/idb-storage
from c8.
I made a PR updating c8 to 3.5.0, changing the format to lcov, and drop the c8 report
command. The line number is corrected now:
https://codecov.io/gh/eight04/idb-storage/pull/5/src/index.js
Travis log:
https://travis-ci.com/eight04/idb-storage/builds/108787127
from c8.
It looks like c8
works fine because I get an html report I can view in my browser after running npx c8 --reporter=lcov npm test && npx codecov
.
So there must be a bug in the codecov
package because files upload successfully and a url is generated for the commit, but visiting the url says there was an error processing reports.
npx: installed 21 in 1.582s
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.3.0
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{ commit: 'd9f760b1523acec516084cb0453ca824950f3f17',
branch: 'circleci',
package: 'node-v3.3.0' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
$ find /home/circleci/repo -type f -name '*.gcno' -exec gcov {} +
==> Scanning for reports
+ /home/circleci/repo/coverage/lcov.info
==> Uploading reports
Success!
View report at: https://codecov.io/github/zeit/tracing-js/commit/d9f760b1523acec516084cb0453ca824950f3f17
Done in 9.27s.
from c8.
@styfle did you try text-lcov
like the nyc
example.
from c8.
same problem
because text-lcov does not output the lcov.info
file in the same place that the lcov reporter does.
from c8.
@styfle @JaKXz text-lcov outputs an lcov report to the terminal, which I believe s service like coveralls should then allow you to pipe to it; here's what I do with coveralls.io:
c8 report --reporter=text-lcov | coveralls"
It looks like maybe codecov only accepts an uploaded file? so I guess the original approach you were taking looks more reasonable.
I'd need to play with codecov.io's interface, but I'm 99% sure the lcov info being output is correct.
from c8.
anyone happen to have codecov configured, and want to try c8 out?
from c8.
@bcoe I'm not sure what file you posted above. Is this a c8 config file?
I tried the latest c8 and codecov cli via npx
and it still fails. I suspect this is a problem with codecov because nyc also failed in the same way but their support has been busy for the last couple months 🤷♂
Can you see this script and this CI job?
I'm using npx c8 --reporter=lcov npm test && npx codecov
.
from c8.
@styfle that is the .c8rc.json
file, we use the public codecov bash script, with most of our libraries on github.com/googleapis, and it seems to work like a charm.
If you share a project with codecov failing, perhaps I could take a look. I also recommend opening an issue on codecov.
from c8.
@bcoe Thanks for the help, I appreciate it!
The project is here: https://github.com/zeit/tracing-js
from c8.
@bcoe I got it working by running tests with ts-node
vercel/tracing-js#26
Here's the script I used:
npx c8 --reporter=lcov tape -r ts-node/register test/**.ts && npx codecov
from c8.
Related Issues (20)
- Include test files in coverage report
- 0% coverage for files only containing TypeScript interfaces HOT 3
- sometimes dead loop, maybe should update foreground-child version HOT 2
- missing coverage of closing brace in switch/case when const is declared HOT 4
- c8 CLI doesn't work properly when executed in a sub-directory of the project HOT 3
- Lines without statements (empty lines) on them are counted as statements HOT 6
- Coverage information too high for large esbuild produced bundle HOT 5
- c8rc extends attribute with relative path not working as expected
- difference between lcov and html reporters?
- Update rimraf (CWE-772) HOT 3
- c8 is cashing filename/directories which do not update on change
- c8 Code Coverage Displaying Code Misses on Multi-line Comments HOT 8
- No longer compatible with Node < 16 since upgrade to foreground-child > 3.x HOT 4
- Different results when using GitHub Actions and TypeScript HOT 4
- Identify what test covers what lines
- Modify coverage ranges for code run in VM HOT 2
- Cannot get coverage report if c8 is running in a sub-directory & src is one level up. HOT 9
- export is instrumented with 0 coverage incase of zero test project HOT 1
- test-exclude pulling in vulnerability from inflight. HOT 2
- Cannot add flags after the script HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c8.