test: verify Maven cache restoration and local .m2 overwrite in CI - #14059
test: verify Maven cache restoration and local .m2 overwrite in CI#14059lqiu96 wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request optimizes the CI build and test process by defaulting unit tests to be skipped in the parent POM for GAPIC-generated clients, while explicitly enabling them in modules with handwritten tests. It also introduces a new compile job type and parallelizes Maven executions. The reviewer provided valuable feedback pointing out critical issues: changing the default Maven goal to compile in the test job completely skips test compilation and execution for the entire repository; changing mvn install to mvn test-compile in the dependency analysis script breaks local artifact resolution; defaulting skipUnitTests to true in the parent POM will silently disable tests for inheriting core modules like google-cloud-core; and using mvn compile instead of mvn test-compile in the compile job ignores test source compilation errors.
| # this should run maven enforcer and compile test dependencies | ||
| mvn test-compile -B -V -ntp \ | ||
| -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C |
There was a problem hiding this comment.
Changing mvn install to mvn test-compile here prevents the built artifacts from being installed to the local Maven repository (~/.m2/repository). Because Maven runs are independent and do not share reactor state across separate invocations, the subsequent mvn dependency:analyze command (on line 63) will fail to resolve any inter-module dependencies within the monorepo, or it will use stale cached versions from previous runs. To ensure correct dependency resolution for independent Maven steps, the artifacts must be installed locally using mvn install (with -DskipTests=true to keep it fast).
| # this should run maven enforcer and compile test dependencies | |
| mvn test-compile -B -V -ntp \ | |
| -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C | |
| # this should run maven enforcer and install dependencies to local .m2 | |
| mvn install -B -V -ntp \ | |
| -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C |
490a637 to
0408151
Compare
|
|



Description
This is a test PR to verify that GitHub Actions: