?? Aggregated Test Report for a Multi-Module Project
Eduard Dubilyer
Co-founder, CTO @ Skipper Soft | Test Automation | Performance | Devops | AI
We received an inquiry from a customer with a well-structured multi-module Java Gradle project. Their test automation setup was solid—UI tests, API tests, and database tests were running seamlessly within their respective modules. After every test execution, reports were generated as expected. ?
Everything seemed perfect.? But there was a problem. ?
While each module produced its own test report, there was no unified view of all test results in one place. For every release, they had to manually collect reports from different folders and piece them together—a tedious process prone to errors. ?
"It’s frustrating," they told us. "We sometimes miss critical failures simply because tracking everything across multiple reports is so cumbersome."
What they needed was clear - an aggregated test report that would consolidate all test results into a single, easy-to-access HTML report at the root project directory.
? Building the Solution:
Since the project was using Gradle 7.2, we knew we had to work within its capabilities. The first step was ensuring that test reports from each module could be collected in a central location.
We modified the test task and introduced a new task - 'aggregateTestReport'
tasks.withType(Test).configureEach {
useJUnitPlatform()
ignoreFailures = true // Continue execution even if tests fail
reports.html.required = true
}
// ?? Aggregate Test Reports in Root Project (Fix for Gradle 7.2)
tasks.register('aggregateTestReport', TestReport) {
destinationDir =
file("$buildDir/reports/tests/aggregate") // ? Correct for Gradle 7.2
// Collect test results from subprojects
subprojects.each { subproject ->
def testTask = subproject.tasks.findByName("test")
if (testTask != null) {
reportOn(testTask.binResultsDir)
}
}
}
?? Running Tests & Generating the Aggregated Report
Now, run the following command to execute tests across all modules and generate the combined test report:
领英推荐
./gradlew clean test --continue aggregateTestReport
?? Where to Find the Aggregated Report?
?? Advantages of Aggregated Test Reporting
? Centralized Report – Easier to analyse test results from all modules in one place
? Better Visibility – Reduces effort in navigating separate module reports
? Ensures Continuous Execution – --continue ensures all tests run even if some fail
? Improves Debugging – Detects failures across modules from a single report
?? Customer’s Reaction
A few days later, we received an email from the customer:
"This has saved us hours of manual effort! Previously, we had to go through multiple test reports scattered across different modules, making debugging a nightmare. Now, with a single consolidated report, tracking failures is effortless. We integrated it into our nightly build pipeline, ensuring a seamless testing workflow. This has significantly improved our visibility into test results and overall project quality. Huge thanks to your team for making this happen!"
Their enthusiasm was evident. No more jumping between reports, no more manual compilation—just one clear, comprehensive test summary.
For us, this was another win. Seeing a well-structured automation framework streamline a team’s workflow is always rewarding. Another automation challenge—solved. ??