测试摘要未填充 CircleCI 中的测试结果

Ale*_*and 6 python junit continuous-integration unit-testing circleci

在 CircleCI 中,我有一个执行自动化测试的构建。它使用nose2junit插件在 XML 文件中生成测试结果。测试结果文件的完整路径为:

/project-folder/test/junit/test-result.xml
Run Code Online (Sandbox Code Playgroud)

文件/project-folder/.circleci/config.yml中的我的 CircleCI 配置包含以下内容:

- store_artifacts:
    path: test/junit/test-results.xml
    destination: test-results

- store_test_results:
    path: test/junit/test-results.xml
Run Code Online (Sandbox Code Playgroud)

当构建执行时,它确认测试结果和工件已正确加载:

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 
Run Code Online (Sandbox Code Playgroud)

但是,测试结果仍然没有出现在“测试摘要”选项卡中(请参见下面的屏幕截图)。

测试摘要为空

我在这里查看了文档:

但我看不到我错过了什么?我也不明白$CIRCLE_TEST_REPORTS上面链接中的变量指的是什么。它包含什么以及我应该如何在我的配置中使用它。

小智 5

要在圆圈上上传测试结果,您必须指定主测试文件夹而不是文件。

在你的情况下应该是

- store_test_results:
    path: test
Run Code Online (Sandbox Code Playgroud)