[ 
https://issues.apache.org/jira/browse/SUREFIRE-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17071725#comment-17071725
 ] 

Simon Levermann edited comment on SUREFIRE-1766 at 3/31/20, 12:19 PM:
----------------------------------------------------------------------

I've created a basic fix for this at 
https://github.com/apache/maven-surefire/compare/master...sonOfRa:testng-params

The CLI output now shows the parameters, as well as the number of the execution 
of the parameterized test that failed *while* the tests are running. In the 
summary,  (under Results: ) however, the information is still missing. If that 
should also be adjusted, can you point me in the direction where the 
adjustments should be made?
{noformat}
[INFO] --- maven-surefire-plugin:3.0.0-SNAPSHOT:test (default-test) @ 
testng-surefire-poc ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running de.slevermann.testng.BadAdderTest
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.186 s 
<<< FAILURE! - in de.slevermann.testng.BadAdderTest
[ERROR] de.slevermann.testng.BadAdderTest.testAddBadly[10, 4](4)  Time elapsed: 
0.001 s  <<< FAILURE!
java.lang.AssertionError: expected [14] but found [10]
        at de.slevermann.testng.BadAdderTest.testAddBadly(BadAdderTest.java:27)

[ERROR] de.slevermann.testng.BadAdderTest.testAddBadlyNoParams  Time elapsed: 
0.001 s  <<< FAILURE!
java.lang.AssertionError: expected [14] but found [10]
        at 
de.slevermann.testng.BadAdderTest.testAddBadlyNoParams(BadAdderTest.java:32)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   BadAdderTest.testAddBadlyNoParams:32 expected [14] but found [10]
[ERROR]   BadAdderTest.testAddBadly:27 expected [14] but found [10]
[INFO] 
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.118 s
[INFO] Finished at: 2020-03-31T14:11:41+02:00
[INFO] ------------------------------------------------------------------------
{noformat}



was (Author: sonofra):
I've created a basic fix for this at 
https://github.com/apache/maven-surefire/compare/master...sonOfRa:testng-params

The CLI output now shows the parameters, as well as the number of the execution 
of the parameterized test that failed *while* the tests are running. In the 
summary,  (under Results:) however, the information is still missing. If that 
should also be adjusted, can you point me in the direction where the 
adjustments should be made?
{noformat}
[INFO] --- maven-surefire-plugin:3.0.0-SNAPSHOT:test (default-test) @ 
testng-surefire-poc ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running de.slevermann.testng.BadAdderTest
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.186 s 
<<< FAILURE! - in de.slevermann.testng.BadAdderTest
[ERROR] de.slevermann.testng.BadAdderTest.testAddBadly[10, 4](4)  Time elapsed: 
0.001 s  <<< FAILURE!
java.lang.AssertionError: expected [14] but found [10]
        at de.slevermann.testng.BadAdderTest.testAddBadly(BadAdderTest.java:27)

[ERROR] de.slevermann.testng.BadAdderTest.testAddBadlyNoParams  Time elapsed: 
0.001 s  <<< FAILURE!
java.lang.AssertionError: expected [14] but found [10]
        at 
de.slevermann.testng.BadAdderTest.testAddBadlyNoParams(BadAdderTest.java:32)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   BadAdderTest.testAddBadlyNoParams:32 expected [14] but found [10]
[ERROR]   BadAdderTest.testAddBadly:27 expected [14] but found [10]
[INFO] 
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.118 s
[INFO] Finished at: 2020-03-31T14:11:41+02:00
[INFO] ------------------------------------------------------------------------
{noformat}


> Surefire does not display TestNG data provider values on command line
> ---------------------------------------------------------------------
>
>                 Key: SUREFIRE-1766
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1766
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: TestNG support
>    Affects Versions: 3.0.0-M4
>         Environment: Maven 3.6.3
> Surefire 3.0.0-M4
> TestNG 7.1.0
>            Reporter: Simon Levermann
>            Priority: Minor
>         Attachments: testng.png
>
>
> When using Surefire's DataProvider annotation, TestNG also exposes the actual 
> parameters that were used for each invocation. These parameters are stored in 
> the testng-results.xml file, and as such, should be available for consumption.
> It looks like they end up in the report HTML files, but they are not shown 
> when running the tests on the command line.
> I've created a small POC repository at 
> [https://github.com/sonOfRa/testng-surefire-poc]. A simple "mvn test" 
> invocation should yield some succeeding and some failing tests. When looking 
> at the  generated HTML reports, they contain the full information. When 
> looking at the command line output, the exact problems are not visible.
> When running the tests in an IDE like IntelliJ IDEA, the parameters are shown 
> alongside the test name. I've attaced a screenshot of this for reference.
> SUREFIRE-382 may be related to  this issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to