Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Gradle build produce HTML test report instead of XML default?

Currently I build my Gradle app by running gradle clean build. This exercises JUnit tests and produces XML test results in my project under build/test-results. I would like to configure my build.gradle file to produce HTML test results (instead of the XML default). Is this possible, if so, how?

like image 726
smeeb Avatar asked Sep 21 '14 20:09

smeeb


People also ask

How do I create a test report in Gradle?

How to generate a Test Report. Gradle generates a Test Report automatically when it runs the entire Test Suite. To do the same, run ./gradlew test (or gradlew. bat test from Windows), or run the test Gradle task from your IDE.

Does Gradle build run tests?

By default, Gradle will run all tests that it detects, which it does by inspecting the compiled test classes. This detection uses different criteria depending on the test framework used. For JUnit, Gradle scans for both JUnit 3 and 4 test classes.

Does Gradle run tests in parallel by default?

Parallel execution Yet Gradle will only run one task at a time by default, regardless of the project structure (this will be improved soon). By using the --parallel switch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects.

Does JUnit generate report?

By default, JUnit tests generate simple report XML files for its test execution. These XML files can then be used to generate any custom reports as per the testing requirement. We can also generate HTML reports using the XML files.


1 Answers

test {     reports {         junitXml.enabled = false         html.enabled = true     }                } 

To figure this out on your own, start from Test in the Gradle Build Language Reference, then drill down into (the type for) reports.

like image 199
Peter Niederwieser Avatar answered Oct 08 '22 02:10

Peter Niederwieser