Skip to content

Commit

Permalink
Print JUnit test results in log.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvertdw committed Aug 26, 2024
1 parent fbe1cf2 commit 3f26a9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Run Tests
run: gradle test

- name: Print Test Results
run: gradle printJUnitXMLs

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
Expand Down
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ ihmc {
configurePublications()
}

categories.configure("fast") {
junit5ParallelEnabled = true
jvmArguments += "-Dlog4j2.configurationFile=log4j2NoColor.yml"
}

categories.configure("allocation") {
junit5ParallelEnabled = true
jvmArguments += "allocationAgent"
Expand All @@ -39,3 +44,14 @@ testDependencies {
api(ihmc.sourceSetProject("main"))
api(ihmc.sourceSetProject("testing"))
}

tasks.register("printJUnitXMLs")
{
doLast {
val buildDir = ihmc.sourceSetProject("test").layout.buildDirectory

buildDir.asFile.get().walk()
.filter { it.isFile && it.path.matches(Regex(".*TEST-.*.xml"))}
.forEach { file -> logger.quiet(file.readText()) }
}
}

0 comments on commit 3f26a9d

Please sign in to comment.