@@ -54,6 +54,13 @@ sourceSets {
5454 }
5555 resources. srcDir file(' src/integrationTest/resources' )
5656 }
57+ pactVerificationTest {
58+ java {
59+ compileClasspath + = sourceSets. main. output
60+ runtimeClasspath + = sourceSets. main. output
61+ }
62+ resources. srcDir file(' src/pactVerificationTest/resources' )
63+ }
5764}
5865
5966configurations {
@@ -63,6 +70,9 @@ configurations {
6370 integrationTestImplementation. extendsFrom testImplementation
6471 integrationTestRuntimeOnly. extendsFrom runtimeOnly
6572
73+ pactVerificationTestImplementation. extendsFrom testImplementation
74+ pactVerificationTestRuntimeOnly. extendsFrom runtimeOnly
75+
6676 // Ensure testRuntimeClasspath can be resolved for agent injection
6777 testRuntimeClasspath {
6878 canBeResolved = true
@@ -284,15 +294,24 @@ dependencies {
284294 }
285295
286296 tasks. register(' pactVerificationTest' , Test ) {
297+ description = " Runs Pact provider verification tests"
298+ group = " Verification"
299+ testClassesDirs = sourceSets. pactVerificationTest. output. classesDirs
300+ classpath = sourceSets. pactVerificationTest. runtimeClasspath
287301 useJUnitPlatform {
288302 includeTags ' pact'
289303 }
304+ failFast = true
290305 systemProperty ' pact.broker.url' , System . getenv(' PACT_BROKER_URL' )
291306 systemProperty ' pact.broker.token' , System . getenv(' PACT_BROKER_TOKEN' )
292307 systemProperty ' pact.provider.version' , System . getenv(' GIT_COMMIT' ) ?: ' dev'
293308 systemProperty ' pact.provider.branch' , System . getenv(' GIT_BRANCH' )
294309 systemProperty ' pact.verifier.publishResults' , System . getenv(' PACT_VERIFIER_PUBLISH_RESULTS' )
295310 systemProperty ' pact.broker.host' , System . getenv(' PACT_BROKER_HOST' )
296311 systemProperty ' pact.env' , System . getenv(' PACT_ENV' )
312+ reports {
313+ junitXml. required. set(true )
314+ html. required. set(true )
315+ }
297316 }
298317}
0 commit comments