简体   繁体   English

为什么我的 AWS CodeBuild 测试报告导致“不完整”状态?

[英]Why does my AWS CodeBuild test report result in an 'Incomplete' status?

I am trying to understand why my JUnit XML report results in an Incomplete status on AWS CodeBuild.我试图了解为什么我的 JUnit XML 报告在 AWS CodeBuild 上导致不完整状态。

The XML is produced by Kaocha, a Clojure test runner, through its kaocha-junit-xml plugin . XML 由 Clojure 测试运行程序kaocha-junit-xml plugin通过其kaocha-junit-xml plugin

At the end of my test run, the XML is generated and then processed in the UPLOAD_ARTIFACTS phase which is where it does a calculation and that results in:在我的测试运行结束时,生成 XML,然后在UPLOAD_ARTIFACTS阶段进行处理,在该阶段进行计算并导致:

error processing report: [InvalidInputException: Test summary: status count cannot be negative]]

I do have multiple assertions per test, and thus there may be more than 1 failure per test.每个测试我确实有多个断言,因此每个测试可能有 1 个以上的失败。 To verify that I'm not having a buggy JUnit XML file, I have installed Jenkins and ran a couple of tests, which works and it does not end in an Incomplete Report status.为了验证我没有错误的 JUnit XML 文件,我安装了 Jenkins 并运行了一些测试,这些测试有效并且不会以Incomplete报告状态结束。

Note that the Test Run status is Failed , and only the Report status is Incomplete .请注意,测试运行状态为Failed ,只有报告状态为Incomplete

Please review your testsuite property in the JUnit XML, eg请在 JUnit XML 中查看您的testsuite属性,例如

tests="1" failures="1" errors="1"

Here, the failures and errors are treated differently and this makes the errors = 2 (1+1) which is less than the number of tests (= 1) causing the negative status count (1-2).在这里,失败和错误的处理方式不同,这使得错误 = 2 (1+1),这小于导致负状态计数 (1-2) 的测试次数 (= 1)。

I am not sure about the JUnit format, but if you can tweak it and make sure either failure or error is populated (not both), then this error ("status count cannot be negative") will not appear.我不确定 JUnit 格式,但如果您可以调整它并确保填充失败或错误(不是两者),则不会出现此错误(“状态计数不能为负”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM