Lori Maurais
05/23/2023, 4:21 PMLori Maurais
05/23/2023, 4:21 PMRUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
[12:18:55.275] INFO (86088): pact@11.0.2: Verifying message
[12:18:55.299] INFO (86088): pact-core@13.13.8: Verifying Pacts.
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
2023-05-23T16:18:57.198115Z WARN ThreadId(20) pact_models::pact: No metadata found in pact file "<https://linostest.pactflow.io>", assuming V3 specification
2023-05-23T16:18:57.199289Z WARN ThreadId(20) pact_models::pact: No metadata found in pact file "<https://linostest.pactflow.io>", assuming V
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
2023-05-23T16:18:59.216868Z INFO ThreadId(20) pact_verifier::pact_broker: Fetching path '/pacts/provider/linos-backend/for-verification' fr
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
2023-05-23T16:19:00.123939Z ERROR ThreadId(20) pact_verifier: Failed to load pact - Could not load pacts from the pact broker '<https://linostest.pactflow.io>'
2023-05-23T16:19:00.124025Z WARN ThreadId(20) pact_matching::metrics:
Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
FAIL apps/core-service/src/tests/Contract/aapiContract2.spec.ts (13.017s)
message provider tests
send an event
✕ Damaged flowrack inventory exception (5024ms)
● message provider tests › send an event › Damaged flowrack inventory exception
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
69 |
70 | describe('send an event', () => {
> 71 | it('Damaged flowrack inventory exception', () => {
| ^
72 | return p.verify();
73 | });
74 | });
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (apps/core-service/src/tests/Contract/aapiContract2.spec.ts:71:5)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 13.097s
Ran all test suites matching /.\/apps\/core-service.+\aapiContract2.spec.ts/i.
Verifying a pact between consumer and provider
WARNING: Pact file has no interactions
Failures:
1) Failed to load pact - Could not load pacts from the pact broker '<https://linostest.pactflow.io>'
There were 1 pact failures
[12:19:00.544] ERROR (86088): pact-core@13.13.8: Verification unsuccessful
/Users/m_884005/Documents/Lineage/repos/linos-backend/nestjs-monorepo/node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.js:62
reject(new Error('Verfication failed'));
^
Error: Caught error after test environment was torn down
Verfication failed
at /Users/m_884005/Documents/Lineage/repos/linos-backend/nestjs-monorepo/node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:52:20
Matt (pactflow.io / pact-js / pact-go)
Slackbot
05/23/2023, 9:47 PMLori Maurais
05/23/2023, 9:54 PMconst baseOpts = {
// logLevel: 'DEBUG',
provider: 'linos-backend',
providerVersion: '1.0', // process.env.GIT_COMMIT,
pactBroker: '<https://linostest.pactflow.io>',
consumerVersionTags: [],
// providerVersionTags: process.env.GIT_BRANCH ? [process.env.GIT_BRANCH] : [],
// pactBrokerUrl: ,
pactBrokerToken: 'ogmEqX8PNkmfHnOJ4W16TQ',
};
// For builds triggered by a 'contract content changed' webhook,
// just verify the changed pact. The URL will bave been passed in
// from the webhook to the CI job.
const pactChangedOpts = {
pactUrls: ['<https://linostest.pactflow.io>'],
};
// For 'normal' provider builds, fetch `master` and `prod` pacts for this provider
const fetchPactsDynamicallyOpts = {
provider: 'linos-backend',
consumerVersionTags: ['master', 'prod', 'main'], // the old way of specifying which pacts to verify
// consumerVersionSelectors: [{ tag: 'master', latest: true }, { tag: 'prod', latest: true } ], // the new way of specifying which pacts to verify
pactUrls: ['<https://linostest.pactflow.io>'],
pactBrokerUrl: '<https://linostest.pactflow.io>',
pactBrokerToken: 'ogmEqX8PNkmfHnOJ4W16TQ',
enablePending: false,
};
const opts = {
...baseOpts,
...(process.env.PACT_URL ? pactChangedOpts : fetchPactsDynamicallyOpts),
messageProviders: {
'Damaged flowrack inventory exception': () =>
// messageService.sendMissingFlowrackInventoryRequest('46',{
messageService.buildAAPIMessage({
type: 'MissingFlowrackInventoryRequest',
input,
facilityId: 'facilityId',
}),
},
};
it('Damaged flowrack inventory exception - message provider pact', () => {
const p = new MessageProviderPact(opts);
// let msg = messageService.buildAAPIMessage({
// type: 'MissingFlowrackInventoryRequest',
// input,
// facilityId: 'facilityId',
// })
// console.log("Message: " + msg)
console.log(`opts: ${JSON.stringify(opts, undefined, 2)}`);
return p.verify();
});
Lori Maurais
05/23/2023, 9:54 PMconsole.log
opts: {
"provider": "linos-backend",
"providerVersion": "1.0",
"pactBroker": "<https://linostest.pactflow.io>",
"consumerVersionTags": [
"master",
"prod",
"main"
],
"pactBrokerToken": "ogmEqX8PNkmfHnOJ4W16TQ",
"pactUrls": [
"<https://linostest.pactflow.io>"
],
"pactBrokerUrl": "<https://linostest.pactflow.io>",
"enablePending": false,
"messageProviders": {}
}
Lori Maurais
05/23/2023, 9:58 PMopts: {
"provider": "linos-backend",
"providerVersion": "1.0",
"pactBroker": "<https://linostest.pactflow.io>",
"consumerVersionTags": [
"master",
"prod",
"main"
],
"pactBrokerToken": "ogmEqX8PNkmfHnOJ4W16TQ",
"pactBrokerUrl": "<https://linostest.pactflow.io>",
"enablePending": false,
"messageProviders": {}
}
Matt (pactflow.io / pact-js / pact-go)
pactUrls
item? That should be populated by values from a webhook, or if you have a direct URL to a pact you want to verifyMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Lori Maurais
05/24/2023, 12:27 PM> nestjs-monorepo@0.0.1 test:contract2
> jest --testTimeout 30000 --no-cache './apps/core-service.+\aapiContract2.spec.ts' --maxWorkers=4
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
Error: Watchman error: std::__1::system_error: open: /Users/m_884005/Documents/Lineage/repos/linos-backend/nestjs-monorepo/apps: Operation not permitted. Make sure watchman is running for this project. See <https://facebook.github.io/watchman/docs/troubleshooting>.
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
[08:25:37.718] INFO (10083): pact@11.0.2: Verifying message
console.log
opts: {
"provider": "linos-backend",
"providerVersion": "1.0",
"pactBroker": "<https://linostest.pactflow.io>",
"consumerVersionTags": [
"master",
"prod",
"main"
],
"pactBrokerToken": "xxxxxxx",
"pactBrokerUrl": "<https://linostest.pactflow.io>",
"enablePending": false,
"messageProviders": {}
}
at Object.<anonymous> (apps/core-service/src/tests/Contract/aapiContract2.spec.ts:76:13)
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
2023-05-24T12:25:39.785510Z INFO ThreadId(17) pact_verifier::pact_broker: Fetching path '/pacts/provider/linos-backend/for-verification' from pact
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
2023-05-24T12:25:40.553318Z ERROR ThreadId(17) pact_verifier: Failed to load pact - Could not load pacts from the pact broker '<https://linostest.pactflow.io>'
2023-05-24T12:25:40.554256Z WARN ThreadId(17) pact_matching::metrics:
Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
RUNS apps/core-service/src/tests/Contract/aapiContract2.spec.ts
Failures:
1) Failed to load pact - Could not load pacts from the pact broker '<https://linostest.pactflow.io>'
There were 1 pact failures
FAIL apps/core-service/src/tests/Contract/aapiContract2.spec.ts (11.558s)
message provider tests
✕ Damaged flowrack inventory exception - message provider pact (3600ms)
● message provider tests › Damaged flowrack inventory exception - message provider pact
Verfication failed
at node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:52:20
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 11.636s
Ran all test suites matching /.\/apps\/core-service.+\aapiContract2.spec.ts/i.
(base) m_884005@AMBUS000029 nestjs-monorepo %
Lori Maurais
05/24/2023, 12:30 PMMatt (pactflow.io / pact-js / pact-go)
master
, prod
and main
) but none of the contracts you have published have those tags - hence it can’t find themMatt (pactflow.io / pact-js / pact-go)
main
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
consumerVersionTags
property and it would just find the latest, which is probably fine for a POCLori Maurais
05/25/2023, 1:20 PMLori Maurais
05/25/2023, 6:13 PMMatt (pactflow.io / pact-js / pact-go)