Skip to content

Commit c2282cd

Browse files
gopalldbclaude
andauthored
Fix cache warmer: run real test to resolve surefire provider (#1385)
## Summary The cache warmer was not caching `surefire-junit-platform:3.1.2` because surefire resolves its provider JAR lazily at test execution time, not at plugin initialization. The previous approach (`-Dtest=NoSuchTest`) failed before surefire downloaded the provider. Fix: run a real lightweight test (`DatabricksParameterMetaDataTest#testInitialization`) to force full surefire provider resolution. ### Verified locally All 4 previously missing artifacts are now in the local cache after running the test: - `surefire-junit-platform:3.1.2` (blocked unit-tests + integration tests) - `maven-toolchains-plugin:3.2.0` (blocked unit-tests) - `maven-clean-plugin:3.2.0` (blocked coverage) - `exec-maven-plugin:1.2.1` (blocked coverage) The 5 maven-metadata.xml warnings are non-blocking (Maven falls back to cached plugin JARs). ## Test plan - [x] Verified locally: `mvn -pl jdbc-core test -Dtest="DatabricksParameterMetaDataTest#testInitialization"` passes and resolves all missing plugins - [ ] After merge: re-trigger cache warmer on main, then re-run PR #1371 CI NO_CHANGELOG=true This pull request was AI-assisted by Isaac. --------- Signed-off-by: Gopal Lal <gopal.lal@databricks.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 77f8c84 commit c2282cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/warmMavenCache.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,18 @@ jobs:
142142
# build-time plugins (spotless, toolchains, owasp) that mvn install alone
143143
# doesn't trigger.
144144
145-
echo "=== Step 2: Running unit test compilation + surefire resolution ==="
146-
mvn -B -pl jdbc-core test -Dtest=NoSuchTest -DfailIfNoTests=false -Ddependency-check.skip=true || true
145+
# Step 2: Run a real unit test to trigger full surefire provider resolution.
146+
# surefire-junit-platform is resolved lazily at test execution time, not at
147+
# plugin initialization. We need at least one test to actually run.
148+
echo "=== Step 2: Running a single unit test to resolve surefire provider ==="
149+
mvn -B -pl jdbc-core test -Dtest="DatabricksParameterMetaDataTest#testInitialization" -Ddependency-check.skip=true || true
147150
148151
echo "=== Step 3: Running spotless check ==="
149152
mvn -B --errors spotless:check || true
150153
154+
# Step 4: Run jacoco with a real test to resolve jacoco agent + report plugins
151155
echo "=== Step 4: Running jacoco coverage ==="
152-
mvn -B -pl jdbc-core test -Dtest=NoSuchTest -DfailIfNoTests=false jacoco:report -Ddependency-check.skip=true || true
156+
mvn -B -pl jdbc-core test -Dtest="DatabricksParameterMetaDataTest#testInitialization" jacoco:report -Ddependency-check.skip=true || true
153157
154158
echo "=== Step 5: Running integration test compilation ==="
155159
mvn -B -pl jdbc-core compile test-compile -Ddependency-check.skip=true || true

0 commit comments

Comments
 (0)