This work is licensed under Apache License 2.0
A Gradle plugin that produces a detailed test skip-reason report, differentiating between:
| Category in report | Cause |
|---|---|
|
|
|
A whole test class disabled by a condition |
|
|
|
Gradle |
|
|
|
Fallback: skip seen only by Gradle, with no JUnit reason |
The report is written to build/reports/skip-reasons.psv (pipe-separated, with header) so it can be parsed after a full run instead of using --test-dry-run.
Getting started
Plugin Id: org.infosmid.plugins.skip-report
Version: 1.0.0
The plugin and the listener are published to Maven Central and the plugin is also published to the Gradle Plugin Portal. No extra repository configuration is needed.
Groovy DSL (build.gradle)
plugins {
id 'java'
id 'org.infosmid.plugins.skip-report' version '1.0.0'
}
Kotlin DSL (build.gradle.kts)
plugins {
java
id("org.infosmid.plugins.skip-report") version "1.0.0"
}
Version Catalog (gradle/libs.versions.toml)
Declare the plugin in the catalog:
[versions]
skip-report = "1.0.0"
[plugins]
infosmid-skip-report = { id = "org.infosmid.plugins.skip-report", version.ref = "skip-report" }
Then reference it through the generated libs accessor.
build.gradle)plugins {
id 'java'
alias(libs.plugins.infosmid.skip.report)
}
build.gradle.kts)plugins {
java
alias(libs.plugins.infosmid.skip.report)
}
That’s all. The plugin:
-
adds
org.infosmid:skip-report-listener:1.0.0totestRuntimeOnly, -
calls
useJUnitPlatform(), -
sets the
skipReport.filesystem property, -
writes the report header before tests and the filter footer after.
Applying to all subprojects
Pin the version once in the root project and apply it by id in the subprojects:
// root build.gradle
plugins {
id 'org.infosmid.plugins.skip-report' version '1.0.0' apply false
}
subprojects {
apply plugin: 'java'
apply plugin: 'org.infosmid.plugins.skip-report'
repositories { mavenCentral() }
dependencies {
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
tasks.named('test') {
// optional: see skips even when forking
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}
Modules
| Artifact | Group | Description |
|---|---|---|
|
|
JUnit Platform runtime listener. This is the only layer where skip reasons actually exist. Auto-discovered via ServiceLoader. |
|
|
Gradle plugin. It wires every |
Both modules are released with the same version. The plugin depends on the listener module, so it always adds the matching listener version.
Reading the report
Per-module file: build/reports/skip-reasons.psv. Aggregate after a full run:
find . -path '*/build/reports/skip-reasons.psv' -exec cat {} \;
Parse (example, Groovy):
new File('build/reports/skip-reasons.psv').readLines().drop(1).findAll { it }.each {
def (cat, id, name, src, reason) = it.split(/ \| /, 5)
println "${cat.padRight(20)} ${name} -> ${reason}"
}
Caveats
-
Forked JVMs: each fork’s listener appends to the same file (line-atomic, unordered). Sort by unique id if you need stable ordering.
-
Pure task exclusions never execute, so they produce no per-test rows. The plugin records the patterns (
TASK_EXCLUSION/TASK_FILTER) instead. -
The plugin and listener are built with a Java 21 toolchain. Run Gradle and the tests on Java 21 or later.
Building
./gradlew build
./gradlew siteDocsZip # user guide + Groovydoc, see build/site-docs
./gradlew publishToMavenLocal # install both artifacts into ~/.m2/repository
To consume a locally published build, add mavenLocal() to pluginManagement.repositories and to dependencyResolutionManagement.repositories in the consuming build.