[GRADLE-2465] Use Gradle's HTML test report for TestNG Created: 06/Sep/12  Updated: 01/Jun/13  Resolved: 27/Dec/12

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.4-rc-1

Type: Improvement
Reporter: Szczepan Faber Assignee: Unassigned
Resolution: Fixed Votes: 1

Attachments: Zip Archive gradle_logging.zip    


1. The html test results from TestNG execution don't have the standard out/err for the tests. The html test results from JUnit execution have them.


A workaround to see output from testNG tests is to use Gradle 1.1 (at least) and run with --info. Alternatively, one can attach his own TestOutputListener.

2. The html test results from TestNG execution are not very user friendly and looks ugly.

It would be nice if we have the same html result for testng/junit execution. One possible implementation path to spike is to make TestNG produce the xml junit results so that they can be used later by html report generator. It's important that the testNG results contain the test's output which is not available at the moment in the testNG html results.

Comment by Szczepan Faber [ 06/Sep/12 ]

Possibly related: GRADLE-1252

Comment by Eric Hansen [ 03/Oct/12 ]

In terms of improving the testng test report, I'd also like support for projects that use both testng and junit. Ideally all *unit test results would be in one report, but it could work with distinct reports as long as they don't overwrite each other.

Following instructions from the cookbook results in the {testReportDir}/index.html being overwritten unless a distinct {testReportDir} is set for the testng task. (the Gradle suite/index.html is always available)

I'm interested in helping, please let me know how.

Comment by Szczepan Faber [ 04/Oct/12 ]

Hey Eric,

Thanks for your feedback Here are potential way you can help:


Comment by Marek Gerhart [ 02/Apr/13 ]

Is the 1) also resolved?
I see that testng reports look nice like junit reports, but I can't see any logs logged by log4j in reports. I have configured log4j properly and showStandardStreams is set to true, but reports contain no logs at all (but they are logged in console). If I switch back to junit, the reports contain logs.

Comment by Szczepan Faber [ 04/Apr/13 ]

Hey can you prepare a sample project that reproduces the problem and attach it to this ticket? Thanks!

Comment by Marek Gerhart [ 14/Apr/13 ]

Hi, I attached gradle_logging.zip which contains 2 equal projects - one of them uses testng and the other one uses junit. If you run "gradle test" in both of them and check the reports, only junit also contains logging output in it.

Comment by Marek Gerhart [ 01/Jun/13 ]

Can you please confirm that this is an issue and not my misconfiguration?

Generated at Wed Jun 30 12:22:40 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.