GitHub
08/18/2023, 7:13 PMv18.17.1
Issue Checklist
Please confirm the following:
☑︎ I have upgraded to the latest
☑︎ I have the read the FAQs in the Readme
☑︎ I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle
☐ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem
Expected behaviour
verifyProvider() should throw an error if neither pactUrl nor pactBrokerUrl is specified.
Actual behaviour
If no pact source is specified, i.e. none of the pactBrokerUrl or pactUrl arguments are specified, the provider test passes, which is not the expected behavior.
Steps to reproduce
Example:
const {Verifier} = require('@pact-foundation/pact');
describe('Testing pactVerifier', () => {
it('Test1', () => {
let opts = {
providerBaseUrl: '<http://localhost:8888>',
provider: 'provider-service',
// pactBrokerUrl: '<http://my-pact-broker.com>',
// pactUrls: [__dirname + '/pacts/pact1.json'],
logLevel: 'debug',
verbose: true,
};
return new Verifier(opts).verifyProvider();
});
});
Relevant log files
```
mocha --config tests/.mocharc.js tests/*.spec.jsTesting pactVerifier [230739.402] INFO (7136): pact@12.1.0: Verifying provider [230739.412] INFO (7136): pact@12.1.0: debug request/response logging enabled [230739.427] INFO (7136): pact-core@14.0.3: Verifying Pacts. [230739.428] WARN (7136): pact-core@14.0.3: verbose is deprecated and no longer has any effect [230739.429] INFO (7136): pact-core@14.0.3: Verifying Pact Files [230739.430] DEBUG (7136): pact-core@14.0.3: Initalising native core at log level 'debug' [230739.430] DEBUG (7136): pact-core@14.0.3: binding path #0: : attempting to load native module from: - C:\workspace\Contract\pactify-js\node_modules\@pact-foundation\pact-core\prebuilds\win32-x64 source: pact-js-core binding lookup - You can override via PACT_PREBUILD_LOCATION [230739.451] INFO (7136): 0.4.6: pact native library successfully found, and the correct version 2023-08-18T190739.453045Z DEBUG ThreadId(01) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_new_for_application FFI function invoked 2023-08-18T190739.453892Z DEBUG ThreadId(01) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_set_provider_info FFI function invoked [230739.453] DEBUG (7136): pact-core@14.0.3: 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-08-18T190739.455184Z DEBUG ThreadId(01) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_set_provider_state FFI function invoked 2023-08-18T190739.455381Z DEBUG ThreadId(01) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_set_verification_options FFI function invoked [230739.454] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierSetPublishOptions' was not executed as it had non-fatal validation errors: No publishVerificationResult option / PAC T_BROKER_PUBLISH_VERIFICATION_RESULTS set, or no providerVersion option [230739.455] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierSetConsumerFilters' was not executed as it had non-fatal validation errors: Either no consumerFilters option provide d, or the array was empty [230739.456] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierSetFailIfNoPactsFound' was not executed as it had non-fatal validation errors: No failIfNoPactsFound option provided [230739.457] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierAddCustomHeader' was not executed as it had non-fatal validation errors: No customProviderHeaders option provided [230739.458] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierAddDirectorySource' was not executed as it had non-fatal validation errors: No pactUrls option provided [230739.458] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierBrokerSourceWithSelectors' was not executed as it had non-fatal validation errors: No pactBrokerUrl option / PACT_BR OKER_BASE_URL set, or no provider option set [230739.459] DEBUG (7136): pact-core@14.0.3: the optional ffi function 'pactffiVerifierAddProviderTransport' was not executed as it had non-fatal validation errors: No additional provider transports prov ided 2023-08-18T190739.462216Z DEBUG ThreadId(02) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_execute FFI function invoked 2023-08-18T190739.465204Z 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-08-18T190739.465637Z 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-08-18T190739.466683Z 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-08-18T190739.467228Z DEBUG ThreadId(02) pact_matching:metrics Sending event to GA - {"cd3": "windows-x86_64", "ev": "0", "av": "14.0.3", "el": "Pacts verified", "v": "1", "aip": "true", "aid": "pa ct-core", "ec": "ProviderTest", "tid": "UA-117778936-1", "cid": "39040468befd153a4b7568fcea085b84", "cd6": "pact_ffi", "ds": "client", "ea": "Completed", "cd2": "unknown", "t": "event", "cd7": "1.1.4", "an ": "pact-core"} 2023-08-18T190739.478777Z DEBUG tokio-runtime-worker hyper:clientconnectdns resolving host="www.google-analytics.com" 2023-08-18T190739.546466Z DEBUG ThreadId(02) hyper:clientconnecthttp connecting to 216.58.206.46:443 2023-08-18T190739.605203Z DEBUG ThreadId(02) hyper:clientconnecthttp connected to 216.58.206.46:443 2023-08-18T190739.745215Z DEBUG tokio-runtime-worker hyper:protoh1io flushed 402 bytes 2023-08-18T190739.812187Z DEBUG tokio-runtime-worker hyper:protoh1io parsed 12 headers 2023-08-18T190739.812445Z DEBUG tokio-runtime-worker hyper:protoh1conn incoming body is content-length (35 bytes) 2023-08-18T190739.812659Z DEBUG tokio-runtime-worker hyper:protoh1conn incoming body completed 2023-08-18T190739.812972Z DEBUG ThreadId(02) pact_plugin_driver:plugin manager Shutting down all plugins [230739.812] DEBUG (7136): pact-core@14.0.3: shutting down verifier with handle 0 2023-08-18T190739.814205Z DEBUG ThreadId(01) pact_ffi:verifier pact_ffi:verifier:pactffi_verifier_shutdown FFI function invoked [230739.813] DEBUG (7136): pact-core@14.0.3: response from verifier: null, 0 [230739.813] IN… pact-foundation/pact-js