Commits
Tarun Sukhani authored cfff83891a5
Fix ant unittest target: missing fork+javaagent caused mass false failures
The unittest target ran junitlauncher in-VM, without the
-javaagent:play-${version}.jar argument or the tests-tmp system property
that test-single sets up. Most framework unit tests rely on Play's
HotswapAgent for class instrumentation; without it, class init silently
failed and JUnit reported every method in the affected class as a
failure (yielding the misleading "13/13 failed" / "9/9 failed" pattern
across BinderTest, PluginCollectionTest, GroovyTemplateTest, the
data-binding suite, and others).
`ant test` was unaffected because it runs `clean,jar` first and uses an
antcall path that happened to expose the agent. `ant unittest` invoked
directly - the typical fast-iteration target - was just broken.
Three changes:
- New agent-jar target builds play-${version}.jar from compiled classes
without the heavyweight clean+modules dependencies of the existing
jar target. unittest needs the Premain-Class jar but shouldn't trigger
a full distribution rebuild.
- unittest now depends on `version, agent-jar, compile-unittest` so
${version} resolves and the agent jar is present before tests run.
- Added the same fork block that test-single uses, plus mkdir/delete
for the tests-tmp lifecycle.
`ant clean unittest` now passes 295/295 tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>