Skip to content

Commit 3b79840

Browse files
KanaduchiAnTopch
andauthored
Fix for #3189 - fixed ignored testcases count (#3190)
* Fix for #3189 - fixed ignored testcases count --------- Co-authored-by: Kanaduchi <[email protected]>
1 parent 7c80f4c commit 3b79840

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Fixed: GITHUB-3028: Execution stalls when using "use-global-thread-pool" (Krishn
55
Fixed: GITHUB-3122: Update JCommander to 1.83 (Antoine Dessaigne)
66
Fixed: GITHUB-3135: assertEquals on arrays - Failure message is missing information about the array index when an array element is unexpectedly null or non-null (Albert Choi)
77
Fixed: GITHUB-3140: assertEqualsDeep on Sets - Deep comparison was using the wrong expected value
8+
Fixed: GITHUB-3189: Incorrect number of ignored tests displayed in the XML results
89

910
7.10.2
1011
Fixed: GITHUB-3117: ListenerComparator doesn't work (Krishnan Mahadevan)

testng-core/src/main/java/org/testng/reporters/AbstractXmlReporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public void add(Count count) {
228228
this.failed += count.failed;
229229
this.skipped += count.skipped;
230230
this.retried += count.retried;
231-
this.ignored += count.retried;
231+
this.ignored += count.ignored;
232232
}
233233

234234
private Count(Builder builder) {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package test.reports;
2+
3+
import org.testng.annotations.Ignore;
4+
import org.testng.annotations.Test;
5+
6+
public class SimpleIgnoredSample {
7+
8+
@Test
9+
@Ignore
10+
public void ignored() {}
11+
}

testng-core/src/test/java/test/reports/XmlReporterTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ public void ensureReportGenerationWhenTestMethodIsWrappedWithWrappedTestNGMethod
9393
@Test(description = "GITHUB-2886")
9494
public void ensureConfigurationMethodsAreNotCountedAsSkippedInXmlReports() throws Exception {
9595
File file =
96-
runTest(RuntimeBehavior.FILE_NAME, null, JekyllTestSample.class, HydeTestSample.class);
96+
runTest(
97+
RuntimeBehavior.FILE_NAME,
98+
null,
99+
JekyllTestSample.class,
100+
HydeTestSample.class,
101+
SimpleIgnoredSample.class);
97102
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
98103
DocumentBuilder builder = factory.newDocumentBuilder();
99104
Document doc = builder.parse(file);
@@ -103,8 +108,8 @@ public void ensureConfigurationMethodsAreNotCountedAsSkippedInXmlReports() throw
103108
int total = Integer.parseInt(node.getAttributes().getNamedItem("total").getNodeValue());
104109
int passed = Integer.parseInt(node.getAttributes().getNamedItem("passed").getNodeValue());
105110
int failed = Integer.parseInt(node.getAttributes().getNamedItem("failed").getNodeValue());
106-
assertThat(ignored).isZero();
107-
assertThat(total).isEqualTo(2);
111+
assertThat(ignored).isEqualTo(1);
112+
assertThat(total).isEqualTo(3);
108113
assertThat(passed).isEqualTo(2);
109114
assertThat(failed).isZero();
110115
}

0 commit comments

Comments
 (0)