Ben
02/13/2023, 9:43 PM2023-02-10T14:02:52.604594Z INFO ThreadId(28) pact_verifier: Publishing verification results back to the Pact Broker
2023-02-10T14:02:54.102596Z INFO ThreadId(28) pact_verifier: Results published to Pact Broker
2023-02-10T14:02:54.102673Z ERROR ThreadId(28) pact_verifier: Failed to load pact - Could not load pacts from the pact broker '<https://pact.broker.io>'
Verifying a pact between Open API and User Service
a request for an user
Given an user exists
returns a response which
has status code 200 (OK)
includes headers
has a matching body (OK)
a request for the second user
Given more than 1 user exists
returns a response which
has status code 200 (OK)
includes headers
has a matching body (OK)
a request for two users
Given at least 2 users exists
returns a response which
has status code 200 (OK)
includes headers
has a matching body (OK)
Failures:
1) Failed to load pact - Could not load pacts from the pact broker '<https://pact.broker.io>'
There were 1 pact failures
[11:02:54.455] ERROR (74633): pact-core@13.13.3: Verification unsuccessful
The provider side clearly downloaded and executed the tests, but for some reason says the pacts could not be loaded. Anyone seen this behavior?Beth (pactflow.io/Pact Broker/pact-ruby)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Ben
02/13/2023, 11:05 PMBen
02/14/2023, 9:57 PMBen
02/14/2023, 11:40 PMMatt (pactflow.io / pact-js / pact-go)
INFO level. The logLevel property should be all you need to set.
It’s strange that it can’t find the pacts, but is still verifying something. Are you specifying both a file and a pact broker? Perhaps it can verify the local pact, but can’t connect to the remote broker?Ben
02/15/2023, 12:04 AMBen
02/15/2023, 12:05 AMBen
02/15/2023, 12:05 AMMatt (pactflow.io / pact-js / pact-go)
trace 😬Ben
02/15/2023, 12:40 AMBen
02/15/2023, 12:41 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Ben
02/15/2023, 2:05 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Ben
02/15/2023, 3:37 PMimport { Verifier, VerifierOptions } from '@pact-foundation/pact';
// import path from 'path';
describe('Pact Verification', () => {
const opts: VerifierOptions = {
provider: 'api.open',
pactBrokerUrl: '<https://pact.broker.io>',
pactBrokerUsername: 'pact',
pactBrokerPassword: 'broker',
// // publishVerificationResult: <http://process.env.CI|process.env.CI> === 'true',
publishVerificationResult: true,
providerVersion: '1',
providerBaseUrl: `<http://localhost:4003>`,
pactUrls: [
'<https://pact.broker.io/pacts/provider/User%20Service/consumer/Open%20API/latest>',
],
// stateHandlers: {
// 'an user exists': () => {
// return Promise.resolve(`User already seeded`);
// },
// },
logLevel: 'trace',
};
it('validates the expectations of Matching Service', () => {
return new Verifier(opts).verifyProvider().then(() => {
// console.log('Pact Verification Complete!');
});
});
});Ben
02/15/2023, 3:38 PMstateHandler I'm having trouble with, if anyone has seen something similar.Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Matt (pactflow.io / pact-js / pact-go)
Ben
02/15/2023, 9:39 PM