Skip to content

Commit 25cabda

Browse files
ci(pact): pass -Dsurefire.failIfNoSpecifiedTests=false to mvn -Dtest
When -am pulls apache-client / springboot-server into the reactor, surefire runs in those generated modules too. Since the Pact tests live only in lance-namespace-pact-tests, the -Dtest=... filter matches nothing in the upstream modules and surefire 3.x fails the build by default. Pass failIfNoSpecifiedTests=false to keep surefire silent in those modules, mirroring the local java/Makefile test-pact-* targets.
1 parent 82929c3 commit 25cabda

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/pact.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ jobs:
5656

5757
- name: Run Consumer Pact Tests
5858
# -am builds the apache-client + springboot-server reactor deps the
59-
# pact-tests module pulls in.
59+
# pact-tests module pulls in. We also pass
60+
# -Dsurefire.failIfNoSpecifiedTests=false so that surefire does NOT
61+
# fail the build when -Dtest=NamespaceApiPactTest matches no test in
62+
# the upstream apache-client / springboot-server modules (those
63+
# generated modules contain no Pact tests by design — the tests live
64+
# only in lance-namespace-pact-tests).
6065
working-directory: java
61-
run: mvn -pl lance-namespace-pact-tests -am -Dspotless.skip=true -Dtest=NamespaceApiPactTest test
66+
run: mvn -pl lance-namespace-pact-tests -am -Dspotless.skip=true -Dsurefire.failIfNoSpecifiedTests=false -Dtest=NamespaceApiPactTest test
6267

6368
- name: Publish Pacts to Broker
6469
# Phase 4 guard: only publish when PACT_BROKER_URL secret is configured.
@@ -226,8 +231,10 @@ jobs:
226231
- name: Run Provider Pact Verification
227232
# -am pulls in apache-client + springboot-server, both required by
228233
# the pact-tests module's test classpath (PactTestApplication, fixtures).
234+
# See consumer-java for why -Dsurefire.failIfNoSpecifiedTests=false is
235+
# required (apache-client / springboot-server contain no PactProviderTest).
229236
working-directory: java
230-
run: mvn -pl lance-namespace-pact-tests -am -Dspotless.skip=true -Dtest=PactProviderTest -Dspring.profiles.active=pact test
237+
run: mvn -pl lance-namespace-pact-tests -am -Dspotless.skip=true -Dsurefire.failIfNoSpecifiedTests=false -Dtest=PactProviderTest -Dspring.profiles.active=pact test
231238

232239
# ─────────────────────────────────────────────────────────────────────────
233240
# Can-I-Deploy: only on main with Pact Broker configured

0 commit comments

Comments
 (0)