问题
In CircleCI, I have a build executing automated tests. It generates tests results in an XML file using nose2
and junit
plugin. The complete path of the test result file is:
/project-folder/test/junit/test-result.xml
My CircleCI configuration in the file /project-folder/.circleci/config.yml
contains this:
- store_artifacts:
path: test/junit/test-results.xml
destination: test-results
- store_test_results:
path: test/junit/test-results.xml
When the build executes, it confirms that test results and artifacts are properly loaded:
Uploading artifacts
Uploading /home/circleci/repo/test/junit/test-results.xml to test-results
Uploaded /home/circleci/repo/test/junit/test-results.xml
Uploading test results
Archiving the following test results
* /home/circleci/repo/test/junit/test-results.xml
Uploaded
However, the test results still do not appear in the Test Summary tab (see screenshot below).
I have looked into the documentation here:
- Store test results
- Metadata collection in custom steps
But I fail to see what I am missing? I also do not understand what the variable $CIRCLE_TEST_REPORTS
refers to in the link above. What does it contain and how I should use it in my configuration.
回答1:
To upload tests results on circle, you have to speficy the main test folder not the files.
In your case it should be
- store_test_results:
path: test
来源:https://stackoverflow.com/questions/47236086/test-summary-not-populated-with-test-results-in-circleci