Hi @channel, I’m new to Pact and in need of your g...
# general
s
Hi @channel, I’m new to Pact and in need of your guidance. I have a running api test harness locally on port 3000. I set my providerBaseUrl to this server but when I run the test I see that provider is listening to a different port. Could someone pls point what I’m missing?
Copy code
return new Verifier({
      providerBaseUrl: "<http://localhost:3000>", // <- location of your running provider
      pactUrls: [
        path.resolve(
          process.cwd(),
          "./pacts/sampleConsumer-sampleProvider.json"
        ),
      ],
    })
Copy code
[2022-10-24 06:22:28.693 +0000] TRACE (33504 on xxxxxxx): pact@10.1.4: Verifying pacts with: {"providerStatesSetupUrl":"<http://localhost:64042/_pactSetup>","provider":"sampleProvider","providerBaseUrl":"<http://localhost:64042>","pactUrls":["C:\\Users\\gwenne\\Desktop\\Workspace\\pact-sample-test\\pacts\\sampleConsumer-sampleProvider.json"],"logLevel":"TRACE","validateSSL":true,"changeOrigin":false}
I am receiving failed test but I am not provided with a detailed error.
Copy code
[2022-10-24 06:22:29.452 +0000] ERROR (33504 on xxxxxxx): pact-core@13.10.0: Verification unsuccessful
[2022-10-24 06:22:29.452 +0000] TRACE (33504 on xxxxxxx): pact@10.1.4: Verification failed(Verfication failed), closing server
Pact verification failed :( Error: Verfication failed
    at C:\Users\d832076\Desktop\Workspace\pact-sample-test\node_modules\@pact-foundation\pact-core\src\verifier\nativeVerifier.ts:50:20
m
FYI going forward, best asking in the language specific channel (e.g. #C9VBGLUM9 in this case)
The port in there is a port to a local proxy in Pact JS, nothing to be concerned about. You should be able to see the incoming/outgoing at
trace
level
There should be other logs that explain what is happening, can you please share here?
s
thanks for responding, Matt. this is the log returned.
Copy code
[2022-10-24 06:22:28.605 +0000] INFO (33504 on xxxxxxxxxx): pact@10.1.4: Verifying provider
[2022-10-24 06:22:28.615 +0000] TRACE (33504 on xxxxxxxxxx): pact@10.1.4: Setting up state proxy with path: /_pactSetup
[2022-10-24 06:22:28.690 +0000] TRACE (33504 on xxxxxxxxxx): pact@10.1.4: proxy created, waiting for startup
[2022-10-24 06:22:28.691 +0000] TRACE (33504 on xxxxxxxxxx): pact@10.1.4: Proxy is ready at ::
[2022-10-24 06:22:28.693 +0000] TRACE (33504 on xxxxxxxxxx): pact@10.1.4: Verifying pacts with: {"providerStatesSetupUrl":"<http://localhost:64042/_pactSetup>","provider":"sampleProvider","providerBaseUrl":"<http://localhost:64042>","pactUrls":["C:\\Users\\gwenne\\Desktop\\Workspace\\pact-sample-test\\pacts\\sampleConsumer-sampleProvider.json"],"logLevel":"TRACE","validateSSL":true,"changeOrigin":false}
[2022-10-24 06:22:28.693 +0000] INFO (33504 on xxxxxxxxxx): pact-core@13.10.0: Verifying Pacts.
[2022-10-24 06:22:28.694 +0000] INFO (33504 on xxxxxxxxxx): pact-core@13.10.0: Verifying Pact Files
[2022-10-24 06:22:28.696 +0000] TRACE (33504 on xxxxxxxxxx): pact-core@13.10.0: Initiliasing ffi for the first time
[2022-10-24 06:22:28.696 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: Initalising native core at log level 'TRACE'
[2022-10-24 06:22:28.707 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierSetFilterInfo' was not executed as it had non-fatal validation errors:
[2022-10-24 06:22:28.708 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierSetPublishOptions' was not executed as
it had non-fatal validation errors:
[2022-10-24 06:22:28.709 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierSetConsumerFilters' was not executed as it had non-fatal validation errors:
[2022-10-24 06:22:28.710 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierSetFailIfNoPactsFound' was not executed as it had non-fatal validation errors:
[2022-10-24 06:22:28.711 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierAddCustomHeader' was not executed as it had non-fatal validation errors:
[2022-10-24 06:22:28.712 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: checking source type of given pactUrl: C:\Users\gwenne\Desktop\Workspace\pact-sample-test\pacts\sampleConsumer-sampleProvider.json
[2022-10-24 06:22:28.720 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: adding C:\Users\gwenne\Desktop\Workspace\pact-sample-test\pacts\sampleConsumer-sampleProvider.json as File source
[2022-10-24 06:22:28.721 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: the optional ffi function 'pactffiVerifierBrokerSourceWithSelectors' was not executed as it had non-fatal validation errors:
[2022-10-24 06:22:29.452 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: shutting down verifier with handle 0
[2022-10-24 06:22:29.452 +0000] DEBUG (33504 on xxxxxxxxxx): pact-core@13.10.0: response from verifier: null, 1
[2022-10-24 06:22:29.452 +0000] ERROR (33504 on xxxxxxxxxx): pact-core@13.10.0: Verification unsuccessful
[2022-10-24 06:22:29.452 +0000] TRACE (33504 on xxxxxxxxxx): pact@10.1.4: Verification failed(Verfication failed), closing server
Pact verification failed :( Error: Verfication failed
    at C:\Users\gwenne\Desktop\Workspace\pact-sample-test\node_modules\@pact-foundation\pact-core\src\verifier\nativeVerifier.ts:50:20
Copy code
'pactffi*' was not executed as it had non-fatal validation errors:
I don’t understand what these logs mean
m
they should probably be
trace
logs actually. I’ll make a bug for that
(they aren’t intended for you, is what that means)
That’s unfortunately not very helpful. If you could please provide your test setup or even a repro, that would be really helpful
s
I have a running api test harness on localhost:3000. My provider test script is
t
The request / response logging is actually at
debug
level, or at least it used to be