Store_test_results not working (Circle 2.0)

In one of my projects, I have the following configuration:

- store_test_results:
    path: /tmp/test-results

- store_artifacts:
    path: /tmp/test-results
    destination: test_results

After a build, the artifacts tab shows that the test_results/junit/test-results.xml was uploaded, and if I download it, I can see that it is well-formed. However, Circle still behaves like I didn’t upload anything.

1 Like

I’m having the same issue:

  • The format should be fine, it worked on CircleCI 1.0.
  • store_artifacts stores these results successfully to artifacts.
  • store_test_results doesn’t store anything

If it helps, here is a link to a build (private): https://circleci.com/gh/LidskaSila/Main/901

Also reported in this thread: Test result report not detected.

1 Like

We’re seeing this issue occur when we have both store_artifacts and store_test_results. The test results are stored in the Artifacts section but do not show in the Test Summary section.

We are seeing this when outputting PHPUnit test cases to JUnit XML.

If we use this configuration

  - run:
      shell: /bin/bash
      command: |
        mkdir -p phpunit-out
        vendor/bin/phpunit --log-junit phpunit-out/junit.xml
        echo "done"
      when: always
  - store_test_results:
      path: phpunit-out
  - store_artifacts:
      path: phpunit-out

The step that runs PHPUnit will return a green. The testcase XML output will be parsed and displayed in the CircleCI interface, however, the build will incorrectly show as green - even if there were test cases that failed.

If however we remove the “echo “done”” line, in an attempt to get the build to show red when the test cases fail:

- run:
      shell: /bin/bash
      command: |
        mkdir -p phpunit-out
        vendor/bin/phpunit --log-junit phpunit-out/junit.xml
      when: always
  - store_test_results:
      path: phpunit-out
  - store_artifacts:
      path: phpunit-out

The build will show as a failed build, but will not display the output of the test cases in the interface. You can see the output in the artifacts but no reporting of the test cases.

Ideally we would like the Build to be marked as failed, and the test cases report to be displayed.

We are now seeing the correct behaviour. If someone did something to fix it, thank you!

Hello, I have exactly same problem as allengeer did, but it’s still not working for me. Any help is greatly appreciated.
I store results like this

  - run:
      name: npm test
      command: |
        npm run test-circleci
        mkdir /tmp/test && mkdir /tmp/test/node && mv ./junit.xml /tmp/test/node/junit.xml
  - store_test_results:

path: /tmp/test

Hello,

I have had the same issue and I can’t figure out why it doesn’t works.

This is my circle ci configuration:

- store_artifacts:
    path: ~/repo/test-results.xml
- store_test_results:
    path: ~/repo/test-results.xml

And this is my test command in node js

./node_modules/.bin/nyc ./node_modules/.bin/mocha \
    --reporter mocha-circleci-reporter --slow 0.0001 --timeout 10000 -b \
    -r ts-node/register -P tsconfig.test.json test/**/*.spec.ts

The test-results.xml is uploaded correct on artifacts but this test isn’t visible by the CircleCI.

Node and mocha, and I’m having the same issue. I cannot find any specific resolution on similar threads, beyond an ambiguous statement about requiring “timing data”. What does this mean, and where does it specify this in the documentation?

Same issue here with a simple create-react-app and yarn test --coverage. store_artifacts: seems to at least show the artifacts, but setting up the test summary doesn’t seem to work with store_test_results.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.