-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to publish verification result to broker #1567
Comments
You are using a JUnit test, so you don't need the Pact Gradle plugin command, the normal Gradle test will do. The problem is that Gradle will run your tests in a separate JVM process, so the properties from the command line won't be applied. See https://stackoverflow.com/questions/21406265/how-to-give-system-property-to-my-test-via-gradle-and-d how to set the properties correctly for the test. |
Hey @rholshausen, thanks for getting back.
If I get you correctly, you meant that as long as I ran I tried a couple of ways, but still unable to get it uploaded.
tasks.named('test') {
useJUnitPlatform()
System.setProperty("pact.verifier.publishResults", "true");
} And I ran
And I ran
Also tried Not exactly sure where was configured wrongly, do enlighten. Thank you |
Option 2 is the correct way, don't know why you are getting that error. Try removing the Pact Gradle plugin (you don't need it), or just add an empty |
I made a newbie mistake earlier, and was running the command from the Now that I have switched to the right project, and here's what I tried
Somehow, Also wondering, when would I need to use |
Ah, looks like a Gradle doesn't like you using BTW, the command line value doesn't have to be the same. Try
and then run |
Even better, something like
|
Here is an example you can look at https://github.com/pactflow/example-provider-springboot |
Thanks! That works if I rely on tasks.named('test') {
useJUnitPlatform()
// nothing set here
}
pact {
broker {
pactBrokerUrl = 'http://localhost:9292'
pactBrokerUsername = 'pact'
pactBrokerPassword = 'pact'
}
serviceProviders {
ProfileProvider {
fromPactBroker {
selectors = latestTags('main')
}
providerTags = [project.pactBrokerTag]
}
}
reports {
defaultReports() // adds the standard console output
}
} And I run And I still encounter this error
What is causing this to fail?
I've seen that example before, but it also brings in |
The Pact Gradle plugin provides the I don't know much about Powershell, I've never used it. If you want to use |
It states that Why would I need to start up or shut-down the provider? I'm already running as the provider? |
@rholshausen I have the similar issue with Maven. I want to use the plugin for 'verify_changed_pacts' workflow. We are planning to have to 2 work flows for the provider (similar to https://github.com/pactflow/example-provider-springboot)
As per your suggestion, we don't need to use plugin we can run I can further refine the |
Hi,
I am trying out
Pact
as an exploration project, and right now, I am facing issue to publish the verification result to thebroker
usinggradle plugin
. You can refer to my demo repo for my setup.Disclaimer: I am still trying to learn
Pact
so I might be wrong in certain understanding, so please forgive me if I explain it wrongly.In summary
Spring Boot
docker
pactPublish
My only problem is that I can't publish the result to the broker via
./gradlew pactVerify
commandMy provider setup is as such
My application properties
When running the test (
./gradlew -i clean test
)This is the logs (partial)
For some reason, it states
Skipping publishing of verification results as it has been disabled
but I have it configured topact.verifier.publishResults=true
ingradle.properties
Well, I tried to pass the properties via gradle but encounter errors
./gradlew -i clean test -Ppact.verifier.publishResults=true
I checked, and the closest seem to be this issue 738 but even after setting the
protocol, project.version
, it still doesn't work outBut if I were to run the following command
The test would fail with the following output
However, the failure result would still be published to the broker with the error like such
I did come across this question in SO and have tried to configure via
system property
but it doesn't work out as expected as well.I'm not quite sure what is causing the issue, do let me know if there's something I did wrong, or if I need to provide more information.
Thanks!
The text was updated successfully, but these errors were encountered: