Open gruchika opened 11 years ago
The issue is reproducible for me as well. Skipped tests are being displayed as failed by SuiteRunnerWorker.java. Below is a sample output that confirms the behaviour:
TEST_API
Tests run: 2, Failures: 0, Skips: 2
TEST_API_Suite
I did some analysis on the flow, here is what I have found so far:
In the Invoker.invokeTestMethods(..) method, the current test's result status is set to skipped(3) from failed(2) when there are errors in DP by registerSkippedTestResult() method but the test context(m_testContext) is not being updated anywhere. Since the final suite level stats are being pulled from test context, the skipped tests are being shown as failed ones.
We have found this issue when one of our user reported a bug against apache/maven-surefire-plugin.
Obviously this bug belongs to TestNG.
https://github.com/apache/maven-surefire/pull/70
We found that the TestNG 5.x marked the test with a failure if DataProvider
thew an exception.
Currently TestNG 6.8.8 changed the behavior and listener calls onTestSkipped
which results in situations where people report against apache/maven-surefire-plugin.
Are you willing to keep the behavior of TestNG 5.x in regard of this usecase please?
Encountered a problem when exception is thrown in the dataprovider, onTestSkipped method of listener is called but it is marked as failed in the report(ITestResult object FAILURE status)
onStart
invoked onTestSkipped
onFinish
Suite
Total tests run: 1, Failures: 1, Skips: 0
IN generateReport