TestNG parser fails to find the test results
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
The build fails due to unable to find the TestNG result with the following build log:
1
2
3
4
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
The following appears in the atlassian-bamboo.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
Diagnosis
Open the TestNG result file with a text editor to confirm if the file have invalid character or not.
Cause
The file contain special character and it is not generated with the correct format.
Solution
Resolution
If the file is generated in Bamboo, add the JVM argument-Dfile.encoding=UTF-8
into Bamboo.
Was this helpful?