Jupiter engine is not on the test runtime classpath by convention, so a module can silently run zero tests
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system, testing
Research direction
Start with gradle/test-config.gradle and compare it with grails-gsp/grails-taglib/build.gradle, then run :grails-taglib:test to reproduce the silent zero-test result. The convention should provide the Jupiter engine while the redundant module-local declaration is removed, and the JUnit 5 test should be discovered and executed.
Written by the indexing model from the issue text.
Description
Split out from review discussion on https://github.com/apache/grails-core/pull/16281.
Problem
gradle/test-config.gradle adds testRuntimeOnly 'org.junit.platform:junit-platform-launcher' and calls useJUnitPlatform(), but never adds org.junit.jupiter:junit-jupiter-engine.
Without the engine on the test runtime classpath, JUnit 5 tests are not discovered — and the build does not fail. The test task reports BUILD SUCCESSFUL while executing zero tests.
This was found in grails-gsp/grails-taglib, whose only JUnit 5 test (GroovyPageAttributesTests) had never executed. Reverting just the one-line engine addition in that module reproduces it: :grails-taglib:test succeeds and discovers nothing.
Why it usually works
Every other module with JUnit 5 tests receives the engine only transitively, via runtimeOnly 'org.junit.jupiter:junit-jupiter-engine' in grails-testing-support-core. The six modules that declare junit-jupiter-api without an explicit engine all resolve it that way today. If that transitive edge is ever narrowed, the same silent-skip returns in those modules with a green build.
Suggested fix
Add the Jupiter engine to the gradle/test-config.gradle convention alongside the platform launcher, so no module can silently skip its JUnit 5 tests, and drop the now-redundant module-local declaration in grails-gsp/grails-taglib/build.gradle.
Worth considering alongside this: a guard that fails the build when a test task discovers zero tests in a module that has test sources, so this class of problem cannot be green again.
The module-local fix landed in #16281 to unblock that PR; this issue tracks the convention-level fix.
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 974
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 95
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/grails-core
-
relates-to: external-plugin
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/grails-core#16128 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/grails-core#15764 ·
-
relates-to: documentation weekly-action-item
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/grails-core#15725 ·
-
relates-to: build relates-to: gradle relates-to: grails-hibernate5-dbmigration
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/grails-core#15086 · 2 comments ·
-
relates-to: documentation
Difficulty 1/5 Under an hour Newbie friendliness 68/100
apache/grails-core#14184 · 1 reaction ·
All issues in apache/grails-core
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100