Chris
04/28/2024, 10:45 PM"@pact-foundation/pact": "^12.4.0",
and in the process of sharing an example to get help with my NextJS thread above, I found that if I add pactUrls
(pointing to valid local files) and remove pactBrokerUrl
, pactBrokerUsername
, pactBrokerPassword
and publishVerificationResult
from verifierOpts
then when run provider verification pact attempts to call state change handlers at <http://127.0.0.1>:(RANDOM_PORT)/_pactSetup
even though providerStatesSetupUrl
has never been set up. Also, there is no state defined in the pacts themselves. This appears broken and I'm not sure how to share the NextJS demo project if I cannot package pacts with it.Chris
04/28/2024, 10:52 PMverifierOpts
, pointing at a self-hosted broker:
{
providerBaseUrl: '<http://localhost:3030>',
provider: "Chris' scratch NextJS App",
pactBrokerUrl: '<https://REDACTED>',
consumerVersionSelectors: [
{ mainBranch: true },
{ matchingBranch: true },
{ deployedOrReleased: true }
],
publishVerificationResult: false,
providerVersion: '0.1.0+e4b3c96',
providerVersionTags: [ 'main' ],
providerVersionBranch: 'main',
pactBrokerUsername: 'REDACTED',
pactBrokerPassword: 'REDACTED',
enablePending: true,
includeWipPactsSince: '2024-01-01'
}
Chris
04/28/2024, 10:52 PMverifierOpts
, pointing at a local file:
{
providerBaseUrl: '<http://localhost:3030>',
provider: "Chris' scratch NextJS App",
pactUrls: [
'/home/chris/src/nextjs-scratch/my-app/pacts/Fauxclient-Scratch NextJS Fullstack App.json'
],
consumerVersionSelectors: [
{ mainBranch: true },
{ matchingBranch: true },
{ deployedOrReleased: true }
],
providerVersion: '0.1.0+e4b3c96',
providerVersionTags: [ 'main' ],
providerVersionBranch: 'main',
enablePending: true,
includeWipPactsSince: '2024-01-01'
}
Matt (pactflow.io / pact-js / pact-go)
when run provider verification pact attempts to call state change handlers atthat’s an internal proxy that Pact sets up.even though<http://127.0.0.1>:(RANDOM_PORT)/_pactSetup
has never been set upproviderStatesSetupUrl
Also, there is no state defined in the pacts themselves. This appears broken and I’m not sure how to share the NextJS demo project if I cannot package pacts with it.the state handler is called every time, even if empty (this allows other hooks to run). It shouldn’t cause errors in and of itself. What’s the actual problem you’re seeing?
Chris
04/28/2024, 11:32 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
PACT_BROKER_BASE_URL
or any environment variables like that that? They could be being picked up and used to fetch dynamically alsoMatt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)