I use 'Delete Pacts' from the broker and expecting...
# pact-broker
d
I use 'Delete Pacts' from the broker and expecting it will delete all historical interactions. however, when I run the provider test, it still picks up a very old pact test from broker. Why is that? is there a way we can find all the pact uploaded by consumers and delete them?
b
"delete pacts" still keeps the pact versions and verifications. if you want to start from scratch, delete the integration.
d
okay, I can try that and republish the pact! thanks for the suggestions
um.. doesn't seem it delete all historical pacts, it still have those old ones
Copy code
13:50:04 [ERROR] pactVerificationTestTemplate{PactVerificationContext}[5]  Time elapsed: 0.254 s  <<< FAILURE!
13:50:04 java.lang.AssertionError: Provider state change callback failed
13:50:04 Caused by: au.com.dius.pact.provider.junitsupport.MissingStateChangeMethod: 
13:50:04 Did not find a test class method annotated with @State("UpdateItinerarySimple") 
13:50:04 for Interaction "Post itinerary update request"
UpdateItinerarySimple
has been deleted from consumer side three weeks ago in a feature branch, and never been merged to develop. it's been picked up again by the provider test, even after I deleted the pact integrations
m
how are you deleting the integration? (just want to check we’re talking about the same thing)
d
message has been deleted
from the main menu -> delete integration
b
should the consumer exist at all?
or does it have other providers?
d
it has one another provider, but I didn't touch that in the broker
this is after I republished it
b
republished what?
d
I deleted the integration from the broker UI, then from consumer end, I use a gradle task to republish the pact to the broker
*upload
b
so, what's happening that shouldn't be?
d
then I ran the provider test, it picked up a VERY old pact from the consumer pact. we suppose to start from scratch, why that VERY old one exist in the borker?
b
that's very strange, and not what I would expect.
d
not I expect as well, that's why I am asking if there is a way to check the pact uploaded by consumer
b
unless you can give me an export of your database, I'm not sure what I can do unfortunately.
when you look at the pact in the UI, waht are it's details?
does it say it was recently published?
m
in the verification step, if you enable debug logging (in fact, even at info level) you should be able to see which pacts are being verified. You can then go and look at those pacts in the UI to see if they were recently published or not and other info
d
yep, 17 mins ago
m
what’s the content of that pact?
d
how do I check?
b
click on the pact icon
the one that looks like a document.
d
yep
Copy code
Requests from orion to booking-server
Post itinerary item update request

Post itinerary item update request given updateItineraryItem

Post itinerary update request given bookingBOBackend

Post itinerary update request given updateItinerary

Post itinerary update request given updateItinerarySimple
the old ones appear there
b
the old interactions
d
correct
b
can you run the consumer and double check the pact it is generating?
d
how do I check the pact it generates?
b
can you run the test?
it will write it to a local directory before it publishes it.
where it goes depends on your language
can you ask the consumer team to help you?
d
only this two pact define in the current develop branch
Copy code
@Test
    @PactTestFor(pactMethod = "testPostUpdateItinerary", providerName = "booking-server")
and
Copy code
@Test
    @PactTestFor(pactMethod = "testPostUpdateItineraryItem", providerName = "booking-server")
it's in java, I can try to run it
b
are you using tags or branches?
d
tags I believe
b
on the consumer?
d
yep
b
is the pact you see coming from the right branch?
d
I only got it running from my local branch, it's been disabled from the other branches
b
was it published from CI?
d
in ci/cd yes, but this one is from my local
b
I know with some pact clients, each interaction gets merged into an existing pact file, rather than being wiped at the start of the run.
is it possible there was an old pact file on the machine that published the pact?
d
um.. would it help if I do a clean build?
b
yes
d
I guess the old ones are gone! thanks @Beth (pactflow.io/Pact Broker/pact-ruby) +++
b
Good to hear.
clean build did the trick?
d
yep, exactly