[ https://issues.apache.org/jira/browse/SUREFIRE-875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071818#comment-16071818 ]
Elias Balasis commented on SUREFIRE-875: ---------------------------------------- Thanks [~tibor17], I noticed your comment under [https://github.com/cbeust/testng/issues/1218] I am actually running 1 fork at a time and without any TestNG suites, but, I believe parallel forks are expected to be producing similar {{testng-results.xml}} overwrite side effects. Still, with or without using TestNG suites and with either single fork or parallel forks, {{testng-results.xml}} overwrite is the main issue here. {quote} If TestNG.java would not have such setter, would you implement such listener in Surefire? {quote} I am not sure which "setter" you are talking about. {quote} Is it safe enough to have two listeners with same type? Your embedded in surefire and external from customers. {quote} If I am understanding correctly, I believe it depends on the execution order of the listeners and the hook method used. For my case, I am using the {{onStart}} hook to capture the beginning of each new execution (fork) and manually rename the existing {{testng-results.xml}} of the previous execution. I hope this helps. Finally, assuming generation of {{testng-results.xml}} is handled by "Surefire", I can see the resolution being an additional "Surefire" option specifying the naming convention (e.g. testng-results-1.xml, testng-results-2.xml etc.) or perhaps an implicit naming convention being used without additional option. If generation of {{testng-results.xml}} is handled by "TestNG", then the rename should be handled in TestNG implementation instead possibly paired with an associated "Surefire" pass-through option. I hope this helps. > testng-results contains only last suite execute in forkmode = always > -------------------------------------------------------------------- > > Key: SUREFIRE-875 > URL: https://issues.apache.org/jira/browse/SUREFIRE-875 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin > Affects Versions: 2.12 > Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) > Java version: 1.6.0_30, vendor: Sun Microsystems Inc. > OS name: "linux", version: "3.0.0-20-generic", arch: "amd64", family: "unix" > Reporter: MichaĆ Kalisz > Attachments: misiu.test-0.0.1-SNAPSHOT-test-sources.jar, pom.xml > > > Every fork creates new testng-results.xml by replacing previous one. > If there are two tests class - to suite will be created and only last one > will be visible in testng-results.xml. > In attached project: > Two test classes: > SimpleIT, CopyOfCopyOfSimpleIT > running: mvn verify > Generates two sites: > Running pl.misiu.CopyOfCopyOfSimpleIT > Configuring TestNG with: > org.apache.maven.surefire.testng.conf.TestNGMapConfigurator@771c8a71 > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.362 sec > Running pl.misiu.SimpleIT > Configuring TestNG with: > org.apache.maven.surefire.testng.conf.TestNGMapConfigurator@72c53dce > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.326 sec > In target/failsafe-reports/testng-results.xml > there is only one test SimpleIT (the last execute site) -- This message was sent by Atlassian JIRA (v6.4.14#64029)