Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Bug: Jest and TravisCI "X Failed to read file at" #184

@KL13NT

Description

@KL13NT

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:

  1. Configure travis to run jest to output coverage to coverage folder
  2. 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
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions