【发布时间】:2014-08-14 12:15:56
【问题描述】:
当 Jenkins 尝试通过 Junit 读取结果 xml 文件时出现此错误
这是输出
> 12:47:46 D:\BuildShare\HudsonSlave_SentraSAHI\workspace\SentraIntegrationTesting-LS-Chrome>exit > 0 > 12:47:46 [xUnit] [INFO] - Starting to record. > 12:47:46 [xUnit] [INFO] - Processing JUnit > 12:47:46 [xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern 'SentraIntegrationTesting\SahiJUnitResults\TEST-*.xml' relative to 'D:\BuildShare\HudsonSlave_SentraSAHI\workspace\SentraIntegrationTesting-LS-Chrome' for the testing framework 'JUnit'. > 12:47:47 [xUnit] [ERROR] - The result file 'D:\BuildShare\HudsonSlave_SentraSAHI\workspace\SentraIntegrationTesting-LS-Chrome\SentraIntegrationTesting\SahiJUnitResults\TEST-Sentra_ExternalUrls_chrome.xml' > for the metric 'JUnit' is not valid. The result file has been skipped. > 12:47:47 [xUnit] [INFO] - Failing BUILD because 'set build failed if errors' option is activated. > 12:47:47 [xUnit] [INFO] - There are errors when processing test results. > 12:47:47 [xUnit] [INFO] - Skipping tests recording. > 12:47:47 [xUnit] [INFO] - Stop build. > 12:47:47 Build step 'Publish xUnit test result report' changed build > result to FAILURE
我的 XML 文件如下所示
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" name="Sentra_IntegrationTests.suite.Sentra_ExternalUrls" tests="1" time="173.162">
<testcase classname="Sentra_IntegrationTests.suite.Sentra_ExternalUrls" name="Sentra_ExternalUrls.sah" time="173.162">499Sentra_IntegrationTests__14Aug2014__02_14_57_872Sentra_IntegrationTests.suiteD:\BuildShare\HudsonSlave_SENTRASAHIO\workspace\SentraIntegrationTesting-LS-Oracle-Firefox\SentraIntegrationTesting/SahiScripts/Sentra_IntegrationTests.suite2014-08-14 02:14:57.8712014-08-14 05:19:56.273FAILURE4440411098402null
a=a
baseURL=http://SENTRASAHIO.TEST.LOCAL:8080/Sentra_Latest_Sources_MasterBuild_Oracle_Console/SentraSahi.html?locale=sq
browserOption=-profile C:\Progra~1\sahiPRO\userdata\browser\ff\profiles\sahi0 -no-remote
browserPath=C:\Program Files (x86)\Mozilla Firefox\firefox.exe
browserProcessName=firefox.exe
emailProp=
host=localhost
logsInfo=html:D:\BuildShare\HudsonSlave_SENTRASAHIO\workspace\SentraIntegrationTesting-LS-Oracle-Firefox\SentraIntegrationTesting\target\IntegrationTestResults\Sentra-Latest_Sources-2014-08-13_19-01-21_Build_520_all\2014-08-14_02-14-57,junit:D:\BuildShare\HudsonSlave_SENTRASAHIO\workspace\SentraIntegrationTesting-LS-Oracle-Firefox\SentraIntegrationTesting\SahiJUnitResults
port=9999
sahisid=sahi_b2763f4a05c8b04ec70a774077f99cdaf13d
suiteId=sahi_b2763f4a05c8b04ec70a774077f99cdaf13d
suiteName=Sentra_IntegrationTests.suite
suitePath=D:\BuildShare\HudsonSlave_SENTRASAHIO\workspace\SentraIntegrationTesting-LS-Oracle-Firefox\SentraIntegrationTesting/SahiScripts/Sentra_IntegrationTests.suite
suiteReportId=Sentra_IntegrationTests__14Aug2014__02_14_57_872
threads=1null000
</testcase>
</testsuite>
有什么想法吗? 谢谢 唐娜
【问题讨论】: