Bug: Jest and TravisCI "X Failed to read file at" #184
Comments
I'm open to work on this if it's fixable with a PR, just point me in the right direction (e.g. what to modify). |
Could this be related to a recent release where automatic detection has been changed (or broken)? We've been using We have |
I have the same problem. Also running codecov locally is giving me |
For me running it locally runs flawlessly. Seems to recognise the folders without a problem. I'm on Win8.1 |
I just passed |
I also have met the same in CircleCI. It's getting back to normal behavior by downgrading to v3.7.0, so probably there are any breaks in the latest v3.7.1. v3.7.0...v3.7.1 |
Hello, I have the same problem here but with circleci
I've try rollback on a previous version but still have the issue |
Pinning to I'm curious why, if no reports were found (or there were errors during the scan), why it seemingly proceeded with the upload. ==> Scanning for reports
X Failed to read file at
==> Uploading reports
Success!
View report at: <URL> |
The report seems to exists, I succeffully uploaded it in circleci artifact on the same workflow, but codecov failled |
I think removing brackets UPDATE: This change seems to make no effects to the reported error |
To @yhatt 's point, for future clarity, perhaps that code should be refactored to: patterns = (
"-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' " + And the commented out test in bb79335#diff-0fd0e07cf6d02bf7cf00f18cebb8e6eaL109 could be refactored to try parsing the list of file types from |
I won't be able to test |
In relation to my first comment
It looks like there's been a PR open since August of last year that seemingly would address the issue https://github.com/codecov/codecov-node/pull/144/files. |
CVE-2020-15123 security advisory has been published, affects to < v3.7.1. Pinning 3.7.0 is a workaround for failing to read coverage files but may make to allow command injection attack. Probably the most safe workaround is using v3.7.1 with |
ref: codecov#184 Removing brackets from find arguments (a4cc565) has affected to the result of finding coverage files. This commit reverts brackets to get back the original search condition. Previously brackets were escaped by backslash to avoid opening sub-shell on the shell environment, but no longer need backslashes because of using `execFileSync()` that is disabled shell environment by default.
Using the |
ref: codecov#184 continuous from: ada583b However, it always returns empty result because of the quote has over-included as the filename of search condition. So removed quotes from generated conditions. In addition, removing brackets from find arguments (a4cc565) has affected to the result of finding coverage files. This commit reverts brackets to get back the original search condition. Previously quotes and escaped-brackets are required to run command on the shell environment, but no longer need them because of using `execFileSync()` that is disabled shell environment by default.
ref: codecov#184 continuous from: ada583b However, it always returns empty result because of the quote has over-included as the filename of search condition. So removed quotes from generated conditions. In addition, removing brackets from find arguments (a4cc565) has affected to the result of finding coverage files. This commit reverts brackets to get back the original search condition. Previously quotes and escaped-brackets are required to run command on the shell environment, but no longer need them because of using `execFileSync()` that is disabled shell environment by default.
ref: codecov#184 continuous from: ada583b codecov#180 makes `find` command change to run through `execFileSync()`. However, it always returns empty result because of the quote has over-included as the filename of search condition. So removed quotes from generated conditions. In addition, removing brackets from find arguments (a4cc565) has affected to the result of finding coverage files. This commit reverts brackets to get back the original search condition too. Previously quotes and escaped-brackets are required to run command on the shell environment, but no longer need them because of using `execFileSync()` that is disabled shell environment by default.
Line 493 in 29dd5b6
I've found out In v3.7.1, |
I also got hit by this issue. In my case passing the option codecov --disable=gcov -f ./coverage/lcov.info |
Works for me ! Thanks @josepot |
@josepot that's pretty much exactly what I had in Travis, but the reports were stuck as |
I got the exact same problem... Then I thought:
and a few hours later the codecov "in progress" reports had finished and after that things started working fine again 🤷 My guess is that at some point they decided to kill all the stale "in progress" stuff, but I have no idea I'm just guessing. |
I think it was affected by degraded Codecov web in separately from codecov-node. I hope to notice Codecov to this problem after that regression calmed down. 🥺 |
Hi all, we just pushed |
@thomasrockhu Thank you for taking care of pull request. In my related project, I've confirmed v3.7.2 is getting back it can find out coverage files at CI environment correctly. Outputs in v3.7.1...$ yarn run codecov
yarn run v1.22.4
$ /home/circleci/jsx-slack/node_modules/.bin/codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.7.1
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{
commit: '3b9c444cfc47b48a6213284d86a11677316aed2b',
branch: 'upgrade-dependencies',
package: 'node-v3.7.1'
}
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
Failed to run gcov command.
==> Scanning for reports
X Failed to read file at
==> Uploading reports
Success!
View report at: https://codecov.io/github/speee/jsx-slack/commit/3b9c444cfc47b48a6213284d86a11677316aed2b
Done in 0.95s. Outputs in v3.7.2...$ yarn run codecov
yarn run v1.22.4
$ /home/circleci/jsx-slack/node_modules/.bin/codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.7.2
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{
commit: '5a24cccbdfed600f23381fda005fad026bad3c43',
branch: 'upgrade-dependencies',
package: 'node-v3.7.2'
}
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
Failed to run gcov command.
==> Scanning for reports
+ /home/circleci/jsx-slack/coverage/lcov.info
+ /home/circleci/jsx-slack/coverage/clover.xml
==> Uploading reports
Success!
View report at: https://codecov.io/github/speee/jsx-slack/commit/5a24cccbdfed600f23381fda005fad026bad3c43
Done in 0.92s. |
Had the same issue on Travis CI with |
@thomasrockhu 3.7.2 fixed it on circleci, thanks you ! |
Looks like this has been resolved, thanks everyone! |
Describe the bug
Running
codecov
from TravisCI yieldsX Failed to read file at
when locating files even whencoverage
folder exists in the same level. Works when passing-f ./coverage/clover.xml
though.I tried
pwd
before runningcodecov
and apparently traviscd
s into the project folder, meaning that runningcodecov
should allow it to easily locatecoverage
using relative paths such as./coverage
without having to pass it manually.To Reproduce
Steps to reproduce the behavior:
coverage
folderafter_success
tocodecov
Expected behavior
Should easily locate coverage reports when available relative to project root.
Screenshots
Failing build: Travis Failing Build Report
Passing build: Travis Passing Build Report
Additional context
Full passing
.travis.yml
configuration (remove-f ./coverage/clover.xml to make it fail
):Full
jest.config.js
configuration:The text was updated successfully, but these errors were encountered: