Devin Woods
09/29/2023, 7:32 PMau.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException:
No Pact files were found to verify
Provider: MY-PROVIDER
Consumer: MY-CONSUMER
I've spent a few days on this, and now I am wondering if the issue isn't actually a failure to find Pacts, but a failure of finding Pacts that need to be verified by the provider. After I publish Pacts to the broker from my consumer, I trigger a pipeline in the consumer repo, which seems to always pass 100% of the time. But, when my provider repo initiates the job to verify the Pacts, I will see this exception.
If this is expected, I think that adding the IgnoreNoPactsToVerify annotation would fix this. Wondering if this is by design, or if I have a bug somewhere.
Thanks for the help!Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Slackbot
10/01/2023, 2:13 AMDevin Woods
10/02/2023, 4:43 PMmainline.
We are hitting the issue I described above when Repo B runs their Pacts as a part of their normal pipeline flow. When they are running their Pact verify job (which stands up the service and runs the pacts), they always point at our mainline branch.Matt (pactflow.io / pact-js / pact-go)
Devin Woods
10/03/2023, 4:23 PMdevelop branch (this is the main branch for their repo) and pass in a variable which gets passed into their selector code:
@PactBrokerConsumerVersionSelectors
fun consumerVersionSelectors(): SelectorBuilder {
val selectorBuilder: SelectorBuilder = SelectorBuilder()
return selectorBuilder.branch(System.getProperty("consumer.branch", "mainline"), "SOS")
}
In Repo B (provider), as a part of their MR pipeline, they always point to Repo A's mainline branch (this is the main branch for our repo).
This is what makes me wonder if I have my mental image of the flow wrong. Whenever Repo A has an MR, we publish the new pacts and immediately ask Repo B to verify.Devin Woods
10/03/2023, 6:06 PMMatt (pactflow.io / pact-js / pact-go)
mainBranch (that way the provider need not hard code the consumer’s branch). You probably also want deployedOrReleased (see recommended).
If that’s not catching the right stuff, then:
1. there is no branch information on the consumers and they aren’t deployed to any environment
2. there is a bug somewhere
To identify (2), we’d need at least some view of the matrix - are you using the OSS Pact Broker or PactFlow?Ryan Quinn
12/11/2023, 6:00 PMRyan Quinn
12/11/2023, 6:01 PMreturn selectorBuilder.branch(System.getProperty("consumer.branch", "mainline"), "SOS") Gives me this output:
au.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException: No Pact files were found to verify
Provider: DASHBOARD
Consumer: SOS
Source: Pact Broker <https://smartsheet2.pactflow.io> consumerVersionSelectors=[Branch(name=mainline, consumer=SOS, fallback=null)]Ryan Quinn
12/11/2023, 6:01 PMRyan Quinn
12/11/2023, 6:02 PMRyan Quinn
12/11/2023, 6:07 PMselector.mainBranch() returns a similar error as above:
au.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException: No Pact files were found to verify
Provider: DASHBOARD
Consumer: SOS
Source: Pact Broker <https://smartsheet2.pactflow.io> consumerVersionSelectors=[au.com.dius.pact.core.pactbroker.ConsumerVersionSelectors$MainBranch@6cdfd50a]Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
DEBUG level logs with me from the verification process? That would really helpMatt (pactflow.io / pact-js / pact-go)
Slackbot
12/21/2023, 1:18 AM