Point AutoValue invoker at value/src/it for functional tests - #2135
Point AutoValue invoker at value/src/it for functional tests#2135tanvir-ux wants to merge 7 commits into
Conversation
The maven-invoker-plugin on the processor module defaulted to processor/src/it, so the functional (and eclipse-profile) IT projects under value/src/it were never run. Point projectsDirectory at the parent src/it tree so invoker.properties goals/profiles apply again. Fixes google#1558
|
The Auto build has always been too much of a mystery to me. I kicked off CI, which shows: |
Pointing projectsDirectory at value/src/it also pulled in gwtserializer, which is a JDK11+ reactor module, not an invoker project. Restrict pomIncludes to functional/pom.xml. invoker:install defaults to runtime scope, so test-scoped auto-value-annotations never landed in it-repo. Set invoker.install.scope=test so the functional IT can resolve it.
|
@cpovirk yeah — pointing at Fix in
Pushed; CI should re-run. |
|
(also: the new CI run is sitting on |
|
invoker.install.scope=test also tried to install compile-testing's transitive com.sun:tools (JDK tools.jar), which is not on Maven Central. Keep install.scope at runtime and stage auto-value-annotations only through extraArtifacts so the functional IT can still resolve it.
|
@cpovirk thanks — that was from I dropped the broad test-scope install and stage only |
eamonnmcmanus
left a comment
There was a problem hiding this comment.
Thanks for looking into this!
However, I'm not seeing any evidence from the logs that value/ functional tests other than the gwtserializer ones are actually being run. For example AutoValueTest. A good check would be to introduce a call to fail() in one of the test methods there. Then the mvn command from the CI should fail.
|
Sigh, sorry, thanks for checking that :( |
|
@eamonnmcmanus thanks — looking into this now. I'll verify that the |
gradle-test-kit puts JUnit Jupiter on the test classpath, so Surefire auto-selects JUnitPlatformProvider and reports Tests run: 0 for the JUnit 4 suite (AutoValueTest, etc.). Pin surefire-junit4 (and the same for failsafe / GradleIT). This is the real google#1558 failure mode visible in CI logs after the invoker path fix.
|
@eamonnmcmanus good catch — you were right that CI on the previous HEAD was compiling Pushed a fix on this branch: pin |
|
Fwiw, Surefire 3.6 removes surefire-junit4 and always uses Jupiter (running Junit 4 tests with the Vintage engine) So maybe it'd be best to first upgrade to 3.6 (#2134) and then reevaluate how to get the tests to run (if this doesn't directly fix it) |
|
(approving workflows again, though I am hoping to ultimately wait for #2134 and then revert the final commit) |
Surefire 3.6 drops the junit4 provider and always runs through Jupiter. gradle-test-kit still puts Jupiter on the classpath, so add junit-vintage-engine and bump surefire/failsafe to 3.6.0 so AutoValueTest (JUnit 4) actually executes. Addresses review on google#2135 / google#1558.
|
@eamonnmcmanus @tbroyer follow-up: switched the functional IT to Surefire/Failsafe 3.6.0 plus That matches the Surefire 3.6 direction — Jupiter always, JUnit 4 via Vintage — so |
|
Local testing showed:
So I pushed a merge commit. I'll trigger workflows now and see what happens, and I'll retest locally without the |
|
CI shows the expected "failed to discover tests" error. Local testing without the Does it seem reasonable that we'd be able to ultimately revert value/src/it/functional/pom.xml once #2142 is incorporated? |
cpovirk confirmed local CI fails with junit-vintage-engine (junit-jupiter failed to discover tests) and passes without it; google#2140 already unblocked the suite. Keep only the invoker path fix.
|
@cpovirk yes — that sounds right. In fact I just dropped the So this PR should only keep the invoker path fix in Happy to adjust further if the fail()-injection check still doesn't show |
cpovirk
left a comment
There was a problem hiding this comment.
If I put a failure into com.google.auto.value.AutoValueTest.testEmpty and include the Surefire bump to 3.6.0, I get a failing run. We'll get this merged after the bump, unless @eamonnmcmanus again pulls the trick of actually reviewing in more depth than I did and finds something wrong along the way :)
## Summary
- The `maven-invoker-plugin` on `value/processor` defaulted to `processor/src/it`, so the functional IT projects under `value/src/it` (and the eclipse profile pass from `invoker.properties`) never ran.
- Set `projectsDirectory` to `${project.parent.basedir}/src/it` so invoker picks them up again.
- Fixes #1558
- Fixes #2135
FUTURE_COPYBARA_INTEGRATE_REVIEW=#2135 from tanvir-ux:fix/autovalue-functional-invoker-path cb7c910
PiperOrigin-RevId: 979810298
## Summary
- The `maven-invoker-plugin` on `value/processor` defaulted to `processor/src/it`, so the functional IT projects under `value/src/it` (and the eclipse profile pass from `invoker.properties`) never ran.
- Set `projectsDirectory` to `${project.parent.basedir}/src/it` so invoker picks them up again.
- Fixes #1558
- Fixes #2135
FUTURE_COPYBARA_INTEGRATE_REVIEW=#2135 from tanvir-ux:fix/autovalue-functional-invoker-path cb7c910
PiperOrigin-RevId: 979810298
|
Well, I had tested with the Failsafe version bump. I went back to test without that just to be safe, and I got what I assume is a random flake: I'll retest to be extra safe. |
|
Proper error confirmed. |
Summary
maven-invoker-pluginonvalue/processordefaulted toprocessor/src/it, so the functional IT projects undervalue/src/it(and the eclipse profile pass frominvoker.properties) never ran.projectsDirectoryto${project.parent.basedir}/src/itso invoker picks them up again.Fixes #1558
Test plan
mvn -pl value/processor -am verify(or the repobuild-pom.xmlverify job) runs the functional invoker projects