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 cds 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 to codecov
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
};