Hi, I would like to split my jest tests but getting the following error:
# Uploading test results
Unable to save test results from /home/circleci/project/reports/junit
Error error accessing path "/home/circleci/project/reports/junit": stat /home/circleci/project/reports/junit: no such file or directory
Found no test results, skipping
# Uploading artifacts
Uploading /home/circleci/project/reports/junit to ./reports/junit/
No artifact files found at /home/circleci/project/reports/junit
Total size uploaded: 0 B
So every time I run the test, it says:
Error reading historical timing data: file does not exist
Requested weighting by historical based timing, but they are not present. Falling back to weighting by name.
Here is my config:
- run:
name: Run Tests
command: |
TEST=$(circleci tests glob "src/**/*.spec.js" | circleci tests split --split-by=timings)
yarn test:unit:ci $TEST
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/junit/
- store_test_results:
path: ./reports/junit/
- store_artifacts:
path: ./reports/junit/
Please note that yarn test:unit:ci
already includes the --runInBand
option, and the reporters are specified in jest.config.js
as follows:
reporters: process.env['CI'] === '1' ? ['default', 'jest-junit'] : ['default']
jest-junit
is also already installed as part of devDependencies
in package.json
Could anyone spot what I did wrong please? Thanks.