Bug: Jest and TravisCI "X Failed to read file at"
See original GitHub issueIssue Description
Describe the bug
Running codecov
from TravisCI yields X Failed to read file at
when locating files even when coverage
folder exists in the same level. Works when passing -f ./coverage/clover.xml
though.
I tried pwd
before running codecov
and apparently travis cd
s into the project folder, meaning that running codecov
should allow it to easily locate coverage
using relative paths such as ./coverage
without having to pass it manually.
To Reproduce Steps to reproduce the behavior:
- Configure travis to run jest to output coverage to
coverage
folder - Set
after_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
):
language: node_js
node_js:
- '12.16.0'
scripts:
- npm install -g codecov
- npm run build
before_deploy:
- if [ "$TRAVIS_BRANCH" = "development" ]; then npm run alpha; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then npm run release; fi
cache:
directories:
- node_modules
deploy:
provider: npm
cleaup: false
skip_cleanup: true
on:
tags: true
branches:
only:
- master
- development
after_success:
- codecov -f ./coverage/clover.xml # remove -f ./coverage/clover.xml to make it fail
Full jest.config.js
configuration:
module.exports = {
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended'],
coverageDirectory: './coverage',
collectCoverage: true
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:27 (9 by maintainers)
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. https://github.com/codecov/codecov-node/compare/v3.7.0...v3.7.1
Hi everyone and sorry for the delay here. We really appreciate all the conversation, and we are investigating the outage. Thanks @yhatt for this PR. If it looks good, we’ll merge and push a new version
3.7.2