Hi, I'm trying to publish provider tests results to pact-broker with pact-jvm-provider-junit, on documentation they say to set the property
pact.verifier.publishResults
to true.
When I'm running
./gradlew clean -Ppact.verifier.publishResults=true build
The tests status is not updated on broker and I got the message:
[Test worker] WARN au.com.dius.pact.provider.junit.InteractionRunner - Skipping publishing of verification results (pact.verifier.publishResults is not set to 'true')
So, my question is, what's the alternative way to load properties using gradle? Does someone had a similar problem?
Worked on this way:
./gradlew clean build -Dpact.verifier.publishResults=true
or via maven in plugin section:
<configuration>
<pact.verifier.publishResults>true</pact.verifier.publishResults>
</configuration>
But the project use gradle, this is not posible @Artem034
But the project use gradle, this is not posible @Artem034
It just for information, maybe in gradle you can set project variable something like in maven.
Hi, I'm aware this is way too late now for the originator of this question. But, for future requests.
In your project's build.gradle file, within your "test" task, add the following:
test {
....
systemProperties['pact.verifier.publishResults'] = true
}
NOTE: if you only want to publish contracts when they are validated by the pipeline/build process, you may want to "conditionalize" the above statement.
Example:
test {
....
if (System.getenv('JENKINS_HOME')){
systemProperties['pact.verifier.publishResults'] = true
}
} //Where JENKINS_HOME is an environment variable defined/set by Jenkins at build-time.
Most helpful comment
Hi, I'm aware this is way too late now for the originator of this question. But, for future requests.
In your project's build.gradle file, within your "test" task, add the following:
test {
....
systemProperties['pact.verifier.publishResults'] = true
}
NOTE: if you only want to publish contracts when they are validated by the pipeline/build process, you may want to "conditionalize" the above statement.
Example:
test {
....
if (System.getenv('JENKINS_HOME')){
systemProperties['pact.verifier.publishResults'] = true
}
} //Where JENKINS_HOME is an environment variable defined/set by Jenkins at build-time.