Maven Surefire

XML Reports include testcases from previous tests

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0 (2.2 plugin)
  • Fix Version/s: 2.4
  • Component/s: None
  • Labels:
    None
  • Complexity:
    Intermediate
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

to reproduce

1. create the following JUnit tests:

public class TestA extends TestCase {
public void test1() {
}
}

public class TestB extends TestCase {
public void test2() {
}

2. run 'mvn clean install'

note that in TEST-TestB.xml includes testcase results from test1 and test2, even though TestB only has test2()

<testsuite errors="0" skipped="0" tests="1" time="0" failures="0" name="TestB">
...
<testcase time="0" name="test1"/>
<testcase time="0" name="test2"/>
</testsuite>

Issue Links

Activity

Hide
Brice Copy added a comment -

Is there a workaround for this, like using an older version of surefire ?

Show
Brice Copy added a comment - Is there a workaround for this, like using an older version of surefire ?
Hide
Mirko Nasato added a comment -

I'd suggest raising the Priority from Minor to Major.

It may be just a presentation issue, but frankly it's quite annoying to see all the HTML reports incorrect, even for all the Maven plugins themselves

http://maven.apache.org/plugins/maven-install-plugin/surefire-report.html
http://maven.apache.org/plugins/maven-resources-plugin/surefire-report.html
http://maven.apache.org/plugins/maven-ear-plugin/surefire-report.html
...

Show
Mirko Nasato added a comment - I'd suggest raising the Priority from Minor to Major. It may be just a presentation issue, but frankly it's quite annoying to see all the HTML reports incorrect, even for all the Maven plugins themselves http://maven.apache.org/plugins/maven-install-plugin/surefire-report.html http://maven.apache.org/plugins/maven-resources-plugin/surefire-report.html http://maven.apache.org/plugins/maven-ear-plugin/surefire-report.html ...
Hide
Dave Syer added a comment -

I can't understand why this is categorised as "minor". Would it get more attention if someone bumped it up to "major"?

Show
Dave Syer added a comment - I can't understand why this is categorised as "minor". Would it get more attention if someone bumped it up to "major"?
Hide
Klaus Brunner added a comment -

My workaround is to use <forkMode>always</forkMode> in the surefire plugin config of the POM. Slows things down a bit, but at least the reports are coherent.

Show
Klaus Brunner added a comment - My workaround is to use <forkMode>always</forkMode> in the surefire plugin config of the POM. Slows things down a bit, but at least the reports are coherent.
Hide
Lilians Auvigne added a comment -

With workaround

<forkMode>always</forkMode>
or
<forkMode>pertest</forkMode>
, i have always the problem.
I am obliged to use version 2.2 because I use TestNG.

Why the patch is not applied, in 2.3-SNAPSHOT ?

Show
Lilians Auvigne added a comment - With workaround
<forkMode>always</forkMode>
or
<forkMode>pertest</forkMode>
, i have always the problem. I am obliged to use version 2.2 because I use TestNG. Why the patch is not applied, in 2.3-SNAPSHOT ?
Hide
Lilians Auvigne added a comment -

Applied in this commit (see patch in SUREFIRE-122) :

Revision: 479603
Author: jvanzyl
Date: 13:25:21, lundi 27 novembre 2006
Message:
SUREFIRE-114: With forkmode once, XML reports are cumulative
Submitted by: Eugene Zhuravlev
M report/XMLReporter.java


Modified : /maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java

Show
Lilians Auvigne added a comment - Applied in this commit (see patch in SUREFIRE-122) : Revision: 479603 Author: jvanzyl Date: 13:25:21, lundi 27 novembre 2006 Message: SUREFIRE-114: With forkmode once, XML reports are cumulative Submitted by: Eugene Zhuravlev M report/XMLReporter.java
Modified : /maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
Hide
Dan Fabulich added a comment -

This got fixed at some point. Checked in an integration test in revision 597279.

Show
Dan Fabulich added a comment - This got fixed at some point. Checked in an integration test in revision 597279.

People

  • Assignee:
    Unassigned
    Reporter:
    bin zhu
Vote (14)
Watch (9)

Dates

  • Created:
    Updated:
    Resolved: