My testng-results.xml is overwritten and only pop'd by the last test to execute

87 views
Skip to first unread message

Scott Shipp

unread,
Mar 22, 2022, 8:54:06 PM3/22/22
to testng-users
Hi,

Has anyone ever experienced that the target/surefire-reports/testng-results.xml only contains test results from the last test class that was executed?

My project has two different test classes. For our purposes: TestFoo.java and TestBar.java. I am running a mvn clean install in a Jenkins job. At the end of this, only tests from either TestFoo or TestBar show up in testng-results.xml.

If you have any ideas, I'll be glad to hear them.

⇜Krishnan Mahadevan⇝

unread,
Mar 23, 2022, 2:04:25 AM3/23/22
to testng...@googlegroups.com
The file getting overwritten per execution is expected behaviour. 

But the file getting created such that only one of the test classes has an entry is not correct. 

Can you show us the following:

1. What does your pom file plugins section look like. 
2. What version of TestNG are you using ?
3. If possible a standalone project that can be used to reproduce the problem.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

From: 'Scott Shipp' via testng-users <testng...@googlegroups.com>
Sent: Tuesday, March 22, 2022 9:41:28 PM
To: testng-users <testng...@googlegroups.com>
Subject: [testng-users] My testng-results.xml is overwritten and only pop'd by the last test to execute
 
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/a4a3de37-5b90-40d8-b872-3e513083c609n%40googlegroups.com.

Shipp, Scott

unread,
Mar 23, 2022, 12:59:49 PM3/23/22
to testng...@googlegroups.com

I can’t confirm for sure, but I chalk this up to a bug in Maven’s SureFire plugin.

 

I have resolved the issue by creating a testng.xml file with my two classes defined within.

 

Scott

 

From: testng...@googlegroups.com <testng...@googlegroups.com> on behalf of Krishnan Mahadevan <krishnan.ma...@gmail.com>
Date: Tuesday, March 22, 2022 at 11:04 PM
To: testng...@googlegroups.com <testng...@googlegroups.com>
Subject: Re: [testng-users] My testng-results.xml is overwritten and only pop'd by the last test to execute

External Email

--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/DHgMlhQh94Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CANikZLmNsd-11nZm3QGcantXNODFfPq9Qv6chL3MnUo2aA7DLw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages