TestNG parser fails to find the test results

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

The build fails due to unable to find the TestNG result with the following build log: 

simple	24-Apr-2017 21:14:13	Starting task 'TestNG Parser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.testng'
simple	24-Apr-2017 21:14:13	Parsing test results under /Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.13.2/home/xml-data/build-dir/BAM-TEST-JOB1...
simple	24-Apr-2017 21:14:13	Failing task since test cases were expected but none were found.
simple	24-Apr-2017 21:14:13	Finished task 'TestNG Parser' with result: Failed

atlassian-bamboo.log に次のメッセージが出力される。

2017-04-24 21:14:13,966 INFO [16-BAM::Default Agent::Agent:pool-31-thread-1] [TaskExecutorImpl] BAM-TEST-JOB1-53: Starting task 'TestNG Parser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.testng'
2017-04-24 21:14:13,967 INFO [pool-37-thread-1] [TestNGTestReportCollector] File /Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.13.2/home/xml-data/build-dir/BAM-TEST-JOB1/testng-results.xml was passed to TestNG test report collector
2017-04-24 21:14:13,971 INFO [pool-37-thread-1] [TestCollationServiceImpl] Unable to parse file '/Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.13.2/home/xml-data/build-dir/BAM-TEST-JOB1/testng-results.xml but it appears to be a TestNG file. Ignoring exception: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x74 (at char #43378, byte #39999)
java.lang.RuntimeException: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x74 (at char #43378, byte #39999)
	at com.atlassian.bamboo.utils.xml.SMInputCursorIterable$SMInputCursorIterator.advance(SMInputCursorIterable.java:49)
	at com.atlassian.bamboo.utils.xml.SMInputCursorIterable$SMInputCursorIterator.hasNext(SMInputCursorIterable.java:60)
	at com.atlassian.bamboo.plugins.testresultparser.testng.TestNGResultsParser.parseSuite(TestNGResultsParser.java:149)
	at com.atlassian.bamboo.plugins.testresultparser.testng.TestNGResultsParser.parse(TestNGResultsParser.java:97)
	at com.atlassian.bamboo.plugins.testresultparser.testng.TestNGTestReportCollector.collect(TestNGTestReportCollector.java:40)
	at com.atlassian.bamboo.build.test.TestCollationServiceImpl$1$1.run(TestCollationServiceImpl.java:139)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x74 (at char #43378, byte #39999)

診断

Open the TestNG result file with a text editor to confirm if the file have invalid character or not.

原因

The file contain special character and it is not generated with the correct format.

ソリューション

If the file is generated in Bamboo, add the JVM argument -Dfile.encoding=UTF-8 into Bamboo.

Configuring your system properties

最終更新日 2017 年 4 月 24 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.