Édouard Lopez
09/02/2022, 10:04 AM{
"_embedded": {
"pacts": []
},
"_links": {
"self": {
"href": "<http://broker.org/pacts/provider/ms.advice-conversation/for-verification>",
"title": "Pacts to be verified"
}
}
}
Yet I do have contracts in /pacts/provider/ms.advice-conversation/
.
What am I missing here?Édouard Lopez
09/02/2022, 10:08 AMdocker run \
--rm pactfoundation/pact-cli:latest \
pact-broker \
create-environment \
--name prod \
--display-name "Production environment" \
--contact-name "see #pact-contract-testing-support" \
--production \
--broker-base-url $${PACT_BROKER_BASE_URL} \
--verbose
Matt (pactflow.io / pact-js / pact-go)
Fábio Rodrigues
09/02/2022, 10:35 AMFábio Rodrigues
09/02/2022, 10:36 AMÉdouard Lopez
09/02/2022, 2:50 PMFábio Rodrigues
09/02/2022, 2:53 PMFábio Rodrigues
09/02/2022, 2:54 PMFábio Rodrigues
09/02/2022, 2:54 PMConsumerVersionSelectors =
new[] {
new ConsumerVersionSelector {
MainBranch = true,
Consumer = ConsumerParticipant
}
},
Édouard Lopez
09/02/2022, 2:54 PMFábio Rodrigues
09/02/2022, 2:54 PMFábio Rodrigues
09/02/2022, 2:55 PMÉdouard Lopez
09/02/2022, 2:55 PM> Task :testContract FAILED
AdvisorsControllerContractVerificationTest > pactVerificationTestTemplate(PactVerificationContext) > com.manomano.ms.advice_conversation.application.controllers.AdvisorsControllerContractVerificationTest.initializationError FAILED
au.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException: No Pact files were found to verify
Provider: ms.advice-conversation
Source: Pact Broker <https://broker.org>
at app//au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider.provideTestTemplateInvocationContexts(PactJUnit5VerificationProvider.kt:50)
Fábio Rodrigues
09/02/2022, 2:56 PMFábio Rodrigues
09/02/2022, 2:57 PMFábio Rodrigues
09/02/2022, 2:58 PM[10h26] 2022-08-31T07:31:01.8906579Z [DEBUG][pact_verifier::pact_broker] Sending JSON to <https://outsystems.pactflow.io/pacts/provider/application-versioning-service/for-verification> using POST: {"providerVersionTags":[],"includePendingStatus":true,"consumerVersionSelectors":[{"consumer":"publish-service","mainBranch":true}]}
Fábio Rodrigues
09/02/2022, 2:58 PMFábio Rodrigues
09/02/2022, 2:59 PMÉdouard Lopez
09/02/2022, 3:02 PMPOST
with
"{"consumerVersionSelectors":[],"includePendingStatus":false}"
08:59:10.342 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "POST /pacts/provider/ms.advice-conversation/for-verification HTTP/1.1[\r][\n]"
08:59:10.345 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Content-Type: application/json; charset=UTF-8[\r][\n]"
08:59:10.348 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Accept: application/hal+json, application/json[\r][\n]"
08:59:10.349 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Accept-Encoding: gzip, x-gzip, deflate[\r][\n]"
08:59:10.350 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Content-Length: 60[\r][\n]"
08:59:10.351 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Host: <http://broker.org|broker.org> [\r][\n]"
08:59:10.352 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "Connection: keep-alive[\r][\n]"
08:59:10.355 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "User-Agent: Apache-HttpClient/5.1.3 (Java/11.0.16)[\r][\n]"
08:59:10.356 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "[\r][\n]"
08:59:10.361 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 >> "{"consumerVersionSelectors":[],"includePendingStatus":false}"
08:59:10.388 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
08:59:10.388 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "Date: Wed, 31 Aug 2022 08:59:10 GMT[\r][\n]"
08:59:10.388 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "Content-Type: application/hal+json;charset=utf-8[\r][\n]"
08:59:10.388 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "Content-Length: 191[\r][\n]"
08:59:10.388 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "Connection: keep-alive[\r][\n]"
08:59:10.389 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "Vary: Accept[\r][\n]"
08:59:10.389 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "X-Pact-Broker-Version: 2.102.1[\r][\n]"
08:59:10.389 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "X-Content-Type-Options: nosniff[\r][\n]"
08:59:10.389 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
08:59:10.389 [Test worker] DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 << "{"_embedded":{"pacts":[]},"_links":{"self":{"href":"<http://broker.org> /pacts/provider/ms.advice-conversation/for-verification","title":"Pacts to be verified"}}}"
Édouard Lopez
09/02/2022, 3:04 PM4.3.14
Fábio Rodrigues
09/02/2022, 3:44 PMFábio Rodrigues
09/02/2022, 3:44 PMÉdouard Lopez
09/26/2022, 3:51 PMHEAD
as a value
@PactBrokerConsumerVersionSelectors
public static SelectorBuilder consumerVersionSelectors() {
return new SelectorBuilder()
.branch("abmm-5295"); // why do I need to specify the branch?
}
Édouard Lopez
09/26/2022, 3:52 PMFábio Rodrigues
09/26/2022, 3:52 PMÉdouard Lopez
09/27/2022, 11:21 AMabmm-5295
). However, I haven't specified any branch in most of our projets and we still are able to fetch and verify.
Did a default behaviour regarding the contract fetching mechanism changes in the past few months? Or is it cheering luck that they passed?
cc @Matt (pactflow.io / pact-js / pact-go)Édouard Lopez
09/27/2022, 11:29 AMenablePendingPacts = "true"
doesn't prevent initializationError
when I only selection from mainBranch()
(which has no associated contracts)
AdvisorsControllerContractVerificationTest > pactVerificationTestTemplate(PactVerificationContext) > com.manomano.ms.advice_conversation.application.controllers.AdvisorsControllerContractVerificationTest.initializationError FAILED
au.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException at PactJUnit5VerificationProvider.kt:50
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
mainBranch()
and deployedOrReleased()
Édouard Lopez
09/28/2022, 1:33 PMmainBranch
, that's a mistakeBeth (pactflow.io/Pact Broker/pact-ruby)
Édouard Lopez
09/29/2022, 12:49 PM