Alan Boshier
08/01/2024, 8:51 AM@pact-foundation/pact
version 12.5.2
I'm running a local pact verification where I definitely do not want to publish verification results to the broker.
When calling new Verifier(opts).verifyProvider()
and varying the content of opts
I get the following behaviour:
1. Neither publishVerificationResult
nor providerVersion
present as fields - verification proceeds smoothly with no attempt to publish
2. With publishVerificationResult: false
but providerVersion
absent - unexpected error because providerVersion
not specified
3. With publishVerificationResult: false
and providerVersion
set to any string - verification proceeds smoothly but results are published
So it feels like publishVerificationResult: false
is not the same as omitting publishVerificationResult
altogether, which feels slightly odd.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Alan Boshier
08/01/2024, 10:43 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
2024-08-02T065928.136729Z INFO ThreadId(02) verify_provider_async: pact_verifier: Results published to Pact BrokerSo INFO level logs should be enough to show what’s happening - mind sharing those please?
Alan Boshier
08/02/2024, 7:05 AMAlan Boshier
08/02/2024, 8:29 AMpublishVerificationResult: false
which then triggers a validation error because I haven't specified providerVersion
.
This could just be a fault in the validation logic, but I thought it was worth including as maybe its an indicator of the original problem.
this is the first run, with verifier options:
{
"providerBaseUrl": "<http://localhost:58487>",
"providerVersionTags": [],
"publishVerificationResult": false,
"providerBranch": "erewhon",
"logLevel": "info",
"pactBrokerUrl": "https://...",
"provider": "nonesuch",
"consumerVersionSelectors": [
{
"consumer": "foo",
"branch": "develop",
"latest": true
}
]
}
which leads to the following validation error:
[09:22:38.165] INFO (26976): pact@12.5.2: Verifying provider
[09:22:38.183] INFO (26976): pact-core@14.3.8: Verifying Pacts.
[09:22:38.186] ERROR (26976): publishVerificationResult requires the following properties: providerVersion
Error: publishVerificationResult requires the following properties: providerVersion
at logErrorAndThrow (node_modules\@pact-foundation\pact-core\src\logger\index.ts:50:9)
at C:\Dev\git_repos\daisy_uprev\node_modules\@pact-foundation\pact-core\src\verifier\validateOptions.ts:53:23
at C:\Dev\git_repos\daisy_uprev\node_modules\@pact-foundation\pact-core\src\verifier\validateOptions.ts:273:22
at Array.forEach (<anonymous>)
at C:\Dev\git_repos\daisy_uprev\node_modules\@pact-foundation\pact-core\src\verifier\validateOptions.ts:272:21
at Array.forEach (<anonymous>)
at validateOptions (node_modules\@pact-foundation\pact-core\src\verifier\validateOptions.ts:260:5)
at new Verifier (node_modules\@pact-foundation\pact-core\src\verifier\index.ts:16:35)
at exports.default (node_modules\@pact-foundation\pact-core\src\verifier\index.ts:30:56)
at Pact.verifyPacts (node_modules\@pact-foundation\pact-core\src\pact.ts:158:27)
at C:\Dev\git_repos\daisy_uprev\node_modules\@pact-foundation\src\dsl\verifier\verifier.ts:137:29
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Alan Boshier
08/02/2024, 8:49 AMproviderVersion
to get past the validation error. Verifier opts:
{
"providerBaseUrl": "<http://localhost:60429>",
"providerVersionTags": [
"wibble"
],
"logLevel": "info",
"publishVerificationResult": false,
"providerVersion": "1.2.3",
"pactBrokerUrl": "https://...",
"provider": "nonesuch",
"consumerVersionSelectors": [
{
"consumer": "foo",
"branch": "develop",
"latest": true
}
],
"providerVersionBranch": "wibble"
}
output logs (truncated but if you need more let me know):
[09:46:00.179] INFO (15764): pact@12.5.2: Verifying provider
[09:46:00.199] INFO (15764): pact-core@14.3.8: Verifying Pacts.
[09:46:00.201] INFO (15764): pact-core@14.3.8: Verifying Pact Files
[09:46:00.215] INFO (15764): 0.4.20: pact native library successfully found, and the correct version
...
2024-08-02T08:46:00.948007Z INFO ThreadId(09) pact_verifier: Running teardown provider state change handler 'me' for 'a request for me'
2024-08-02T08:46:00.962716Z INFO ThreadId(09) pact_verifier: Publishing verification results back to the Pact Broker
2024-08-02T08:46:00.978726Z INFO ThreadId(09) pact_verifier::pact_broker: Fetching path '/pacticipants/nonesuch' from pact broker
2024-08-02T08:46:01.128692Z INFO ThreadId(09) pact_verifier::pact_broker: Fetching path '/pacticipants/nonesuch' from pact broker
2024-08-02T08:46:01.339507Z INFO ThreadId(09) pact_verifier: Results published to Pact Broker
Matt (pactflow.io / pact-js / pact-go)
PACT_
Alan Boshier
08/05/2024, 8:19 AMPACT_
, but I tried removing those in the first of the two scenarios and it made no difference.