Sayantini Basak
09/12/2023, 5:39 PM[22:51:11.120] INFO (39344): pact@12.1.0: Verifying provider
[22:51:11.373] INFO (39344): pact-core@14.0.4: Verifying Pacts.
[22:51:11.377] WARN (39344): pact-core@14.0.4: Using the tag 'latest' is not recommended and probably does not do what you intended.
[22:51:11.378] WARN (39344): pact-core@14.0.4: See <https://docs.pact.io/pact_broker/tags/#latest-pacts>
[22:51:11.379] WARN (39344): pact-core@14.0.4: If you need to specify latest, try:
[22:51:11.379] WARN (39344): pact-core@14.0.4: consumerVersionSelectors: [{ lastest: true }]
[22:51:11.380] INFO (39344): pact-core@14.0.4: Verifying Pact Files
[22:51:11.382] DEBUG (39344): pact-core@14.0.4: Initalising native core at log level 'DEBUG'
[22:51:11.383] DEBUG (39344): pact-core@14.0.4: binding path #0: : attempting to load native module from:
- C:\Users\saya2660\cxt\rental-customer-service\node_modules\@pact-foundation\pact-core\prebuilds\win32-x64
source: pact-js-core binding lookup
- You can override via PACT_PREBUILD_LOCATION
[22:51:11.505] INFO (39344): 0.4.7: pact native library successfully found, and the correct version
2023-09-12T17:21:11.524666Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_new_for_application FFI function invoked
2023-09-12T17:21:11.537949Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_provider_info FFI function invoked
[22:51:11.541] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierSetFilterInfo' was not executed as it had non-fatal validation errors: None of PACT_DESCRIPTION, PACT_PROVIDER_STATE or PACT_PROVIDER_NO_STATE were set in the environment
2023-09-12T17:21:11.546913Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_provider_state FFI function invoked
2023-09-12T17:21:11.554269Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_verification_options FFI function invoked
[22:51:11.551] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierSetPublishOptions' was not executed as it had non-fatal validation errors: No publishVerificationResult option / PACT_BROKER_PUBLISH_VERIFICATION_RESULTS set, or no providerVersion option
[22:51:11.552] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierSetConsumerFilters' was not executed as it had non-fatal validation errors: Either no consumerFilters option provided, or the array was empty
[22:51:11.553] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierSetFailIfNoPactsFound' was not executed as it had non-fatal validation errors: No failIfNoPactsFound option provided
[22:51:11.556] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierAddCustomHeader' was not executed as it had non-fatal validation errors: No customProviderHeaders option provided
[22:51:11.557] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierAddDirectorySource' was not executed as it had non-fatal validation errors: No pactUrls option provided
2023-09-12T17:21:11.563454Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_broker_source_with_selectors FFI function invoked
[22:51:11.567] DEBUG (39344): pact-core@14.0.4: the optional ffi function 'pactffiVerifierAddProviderTransport' was not executed as it had non-fatal validation errors: No additional provider transports provided
2023-09-12T17:21:11.664723Z DEBUG ThreadId(02) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_execute FFI function invoked
2023-09-12T17:21:11.665825Z DEBUG ThreadId(02) pact_ffi::verifier::handle: Pact source to verify = PactBrokerWithDynamicConfiguration(<http://18.237.96.220:9292/>, provider_name='customer-service', enable_pending=false, include_wip_since=None, provider_tags=["latest"], provider_branch=Some(""), consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: Some("latest"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }], auth=Token(PACT*************)')
2023-09-12T17:21:11.701775Z DEBUG ThreadId(02) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
core/content-generator/json
core/content-matcher/json
core/content-matcher/multipart-form-data
core/content-matcher/text
core/content-matcher/xml
2023-09-12T17:21:11.701953Z DEBUG ThreadId(02) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/matcher/v1-equality
core/matcher/v2-max-type
core/matcher/v2-min-type
core/matcher/v2-minmax-type
core/matcher/v2-regex
core/matcher/v2-type
core/matcher/v3-content-type
core/matcher/v3-date
core/matcher/v3-datetime
core/matcher/v3-decimal-type
core/matcher/v3-includes
core/matcher/v3-integer-type
core/matcher/v3-null
core/matcher/v3-number-type
core/matcher/v3-time
core/matcher/v4-array-contains
core/matcher/v4-equals-ignore-order
core/matcher/v4-max-equals-ignore-order
core/matcher/v4-min-equals-ignore-order
core/matcher/v4-minmax-equals-ignore-order
core/matcher/v4-not-empty
core/matcher/v4-semver
2023-09-12T17:21:11.735709Z INFO ThreadId(02) pact_verifier::pact_broker: Fetching path '/' from pact broker
2023-09-12T17:21:11.747320Z DEBUG ThreadId(02) hyper::client::connect::http: connecting to 18.237.96.220:9292
2023-09-12T17:21:12.034277Z DEBUG ThreadId(02) hyper::client::connect::http: connected to 18.237.96.220:9292
2023-09-12T17:21:12.362421Z DEBUG tokio-runtime-worker hyper::client::pool: pooling idle connection for ("http", 18.237.96.220:9292)
2023-09-12T17:21:12.364975Z DEBUG ThreadId(02) pact_verifier::pact_broker: Link URL is templated
2023-09-12T17:21:12.365079Z DEBUG ThreadId(02) pact_verifier::pact_broker: templated URL = <http://18.237.96.220:9292/pacts/provider/{provider}/for-verification>
2023-09-12T17:21:12.376050Z DEBUG ThreadId(02) pact_verifier::pact_broker: final URL = <http://18.237.96.220:9292/pacts/provider/customer-service/for-verification>
2023-09-12T17:21:12.376229Z INFO ThreadId(02) pact_verifier::pact_broker: Fetching path '/pacts/provider/customer-service/for-verification' from pact broker
2023-09-12T17:21:12.376309Z DEBUG ThreadId(02) hyper::client::pool: reuse idle connection for ("http", 18.237.96.220:9292)
2023-09-12T17:21:12.376613Z DEBUG tokio-runtime-worker hyper::proto::h1::io: flushed 246 bytes
2023-09-12T17:21:12.680599Z DEBUG tokio-runtime-worker hyper::proto::h1::io: parsed 7 headers
2023-09-12T17:21:12.680652Z DEBUG tokio-runtime-worker hyper::proto::h1::conn: incoming body is content-length (2422 bytes)
2023-09-12T17:21:12.680689Z DEBUG tokio-runtime-worker hyper::proto::h1::conn: incoming body completed
2023-09-12T17:21:12.680724Z DEBUG tokio-runtime-worker hyper::client::pool: pooling idle connection for ("http", 18.237.96.220:9292)
2023-09-12T17:21:12.681090Z DEBUG ThreadId(02) pact_verifier::pact_broker: templated URL = <http://18.237.96.220:9292/pacts/provider/customer-service/for-verification>
2023-09-12T17:21:12.683326Z DEBUG ThreadId(02) pact_verifier::pact_broker: final URL = <http://18.237.96.220:9292/pacts/provider/customer-service/for-verification>
2023-09-12T17:21:12.683471Z DEBUG ThreadId(02) pact_verifier::pact_broker: Sending JSON to <http://18.237.96.220:9292/pacts/provider/customer-service/for-verification> using POST: {"providerVersionTags":["latest"],"includePendingStatus":false,"consumerVersionSelectors":[{"tag":"latest","latest":true}],"providerVersionBranch":""}
2023-09-12T17:21:12.683572Z DEBUG ThreadId(02) hyper::client::pool: reuse idle connection for ("http", 18.237.96.220:9292)
2023-09-12T17:21:12.684186Z DEBUG tokio-runtime-worker hyper::proto::h1::io: flushed 458 bytes
2023-09-12T17:21:12.984970Z DEBUG tokio-runtime-worker hyper::proto::h1::io: parsed 7 headers
2023-09-12T17:21:12.985020Z DEBUG tokio-runtime-worker hyper::proto::h1::conn: incoming body is content-length (161 bytes)
2023-09-12T17:21:12.985054Z DEBUG tokio-runtime-worker hyper::proto::h1::conn: incoming body completed
2023-09-12T17:21:12.985089Z DEBUG ThreadId(02) hyper::client::pool: pooling idle connection for ("http", 18.237.96.220:9292)
2023-09-12T17:21:12.987343Z ERROR ThreadId(02) pact_verifier: Could not load pacts from pact broker '<http://18.237.96.220:9292/>': Link/Resource was not found - No pacts were found for this provider
2023-09-12T17:21:12.988589Z ERROR ThreadId(02) pact_verifier: Failed to load pact - Could not load pacts from pact broker '<http://18.237.96.220:9292/>'
2023-09-12T17:21:12.989454Z WARN ThreadId(02) 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'.
2023-09-12T17:21:12.990398Z DEBUG ThreadId(02) pact_matching::metrics: Sending event to GA - {"t": "event", "cd6": "pact_ffi", "ec": "ProviderTest", "cd7": "1.1.5", "cid": "015df3ce8fa36b46e3a85d45041b663b", "ea": "Completed", "ev": "0", "ds": "client", "tid": "UA-117778936-1", "v": "1", "av": "14.0.4", "cd3": "windows-x86_64", "cd2": "unknown", "an": "pact-core", "aip": "true", "el": "Pacts verified", "aid": "pact-core"}
Failures:
1) Failed to load pact - Could not load pacts from pact broker '<http://18.237.96.220:9292/>'
There were 1 pact failures
2023-09-12T17:21:13.247462Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) }
2023-09-12T17:21:13.247543Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::connection: Connection::poll; connection error error=GoAway(b"", NO_ERROR, Library)
2023-09-12T17:21:13.247930Z DEBUG ThreadId(02) pact_plugin_driver::plugin_manager: Shutting down all plugins
[22:51:13.258] DEBUG (39344): pact-core@14.0.4: shutting down verifier with handle 0
2023-09-12T17:21:13.263227Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_shutdown FFI function invoked
[22:51:13.259] DEBUG (39344): pact-core@14.0.4: response from verifier: null, 1
[22:51:13.260] ERROR (39344): pact-core@14.0.4: Verification unsuccessful
FAIL tests/pact-testing/provider.spec.ts (7.312 s)
Pact Provider verification
× Should verify customer rental services contracts (2167 ms)
● Pact Provider verification › Should verify customer rental services contracts
Verfication failed
at node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:52:20
Interestingly, I've noticed that I can successfully run the Pact verification test from the backend if I use the Pact file from my local environment.
Any insights or assistance you can provide on this matter would be greatly appreciated. I'm eager to learn and resolve this issue, and your expertise would be invaluable in helping me move forward.
Thank you in advance for your time and assistance!Yousaf Nabi (pactflow.io)
2023-09-12T17:21:11.665825Z DEBUG ThreadId(02) pact_ffi::verifier:
Pact source to verify = PactBrokerWithDynamicConfiguration(<http://18.237.96.220:9292/>, provider_name='customer-service', enable_pending=false, include_wip_since=None, provider_tags=["latest"], provider_branch=Some(""), consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: Some("latest"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }], auth=Token(PACT*************)')
There is also a warning on your consumer version selectors
WARN (39344): pact-core@14.0.4: Using the tag 'latest' is not recommended and probably does not do what you intended.Yousaf Nabi (pactflow.io)
Sayantini Basak
09/12/2023, 6:03 PMconst port = 3000
const opts = {
provider: "customer-service",
logLevel: "DEBUG",
providerBaseUrl: `<http://localhost>:${port}`,
pactBrokerUrl: `<http://18.237.96.220:9292/>`,
pactBrokerToken: "PACT_BROKER_TOKEN",
consumerVersionSelectors: [{ latest: true }],
publishVerificationResult: false,
providerVersion: "1.0.0"
};Matt (pactflow.io / pact-js / pact-go)
This suggests you are specifying a tag calledCopy code2023-09-12T17:21:12.683471Z DEBUG ThreadId(02) pact_verifier::pact_broker: Sending JSON to <http://18.237.96.220:9292/pacts/provider/customer-service/for-verification> using POST: {"providerVersionTags":["latest"],"includePendingStatus":false,"consumerVersionSelectors":[{"tag":"latest","latest":true}],"providerVersionBranch":""}
latest. Hopefully it’s not Pact JS doing something “clever”.
See https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors for how selectors work and recommended default selectors.
If you’re new, don’t use tags, use branches/environments.Matt (pactflow.io / pact-js / pact-go)
Sayantini Basak
09/13/2023, 2:04 AMlet projectFolder = __dirname;
let pact = require('@pact-foundation/pact-node');
let project = require('./package.json');
let options = {
pactFilesOrDirs: [projectFolder + '/dist/pacts'],
pactBroker: '<http://18.237.96.220:9292/>',
consumerVersion: project.version,
tags: ['latest']
};
pact.publishPacts(options).then(function () {
console.log("Pacts successfully published!");
});Matt (pactflow.io / pact-js / pact-go)
yeah, don’t do that 😛Copy codetags: ['latest']
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
project.version changes with each commitMatt (pactflow.io / pact-js / pact-go)
Sayantini Basak
09/13/2023, 11:13 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Slackbot
09/13/2023, 11:26 AMMatt (pactflow.io / pact-js / pact-go)
Sayantini Basak
09/21/2023, 3:44 PMMatt (pactflow.io / pact-js / pact-go)