question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish test status to broker - pact.verifier.publishResults not been read

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Garcia-JuanLuiscommented, Sep 4, 2020

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.

1reaction
Artem034commented, Nov 29, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publish test status to broker - pact.verifier.publishResults not ...
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
Read more >
Unable to publish the 'Last Verified' status in PACT Broker
I saw some documentation around 'pact.verifier.publishResults=true' and tried to pass as gradle parameter, but I got an error message saying:.
Read more >
Pact junit runner | Pact Docs
Just passing them in on the command line won't work, as they will not be available to the test JVM that is running...
Read more >
Consumer Driven Contract Tests - Part 2 - Swapnil Sankla
Pact looks for an environment variable pact.verifier.publishResults and if it is set to true then the results are published. One can set this ......
Read more >
Integration into build pipeline with Pact Broker and Jenkins
To enable the publishing, the flag pact.verifier.publishResults needs to be set to true in the Jenkinsfile. Additionally, the provider version ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found