Feisal Ahmad
01/31/2025, 11:47 AMpact_verifier_cli
to verify the pact I have now managed to produce using pactffi with the plugin I wrote to add a custom transport as I described before.
I don’t know if I’m just expecting the wrong thing here, but what I hope is possible is to do the following:
1. Run pact_verifier_cli
pointing it to the pact file (I’m just using a local file for now)
2. pact_verifier_cli
loads the plugin and registers a custom transport
3. pact_verifier_cli
verifies the interactions by sending requests over the custom transport, I imagine this would be implemented by the various interaction related rpcs in the plugin service
So far I am seeing in the trace logs of the cli that it tries to send requests directly, ignoring the plugin. I’ve tried several arguments but haven’t gotten anywhere really. It’s loading the plugin fine, which is getting picked up from the pact file, and I see it in the printed catalogue entries:
2025-01-31T11:35:33.117935Z DEBUG main verify_provider{provider_name="provider"}: pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
...
core/matcher/v4-semver
plugin/pact-messagebroker/transport/application/adsk_MessageBroker
Is what I’m trying to do supported? Or do I need to use pactffi to implement the provider tests?Yousaf Nabi (pactflow.io)
Feisal Ahmad
01/31/2025, 11:50 AMpact_verifier_cli --transport adsk_MessageBroker --file pacts/PactMessageBrokerConsumerDSL.tst-LibrariesCore.json -l debug -h 127.0.0.1 -p 50575
Feisal Ahmad
01/31/2025, 11:52 AMFeisal Ahmad
01/31/2025, 11:54 AM"interactions": [
{
"contents": {
"contentType": "application/json",
"encoded": false
},
"description": "libraries/getLibraries/request",
"pending": false,
"providerStates": [
{
"name": "I have a list of libraries"
}
],
"transport": "adsk_MessageBroker",
"type": "Asynchronous/Messages"
}
],
Yousaf Nabi (pactflow.io)
Feisal Ahmad
01/31/2025, 11:57 AMFeisal Ahmad
01/31/2025, 11:58 AMFeisal Ahmad
01/31/2025, 11:59 AMFeisal Ahmad
01/31/2025, 12:00 PMFeisal Ahmad
01/31/2025, 12:11 PMYousaf Nabi (pactflow.io)
Feisal Ahmad
01/31/2025, 12:12 PM2025-01-31T12:05:27.891555Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier: Executing provider states
2025-01-31T12:05:27.891568Z INFO main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier: Running setup provider state change handler 'I have a list of libraries' for 'libraries/getLibraries/request'
2025-01-31T12:05:27.891574Z WARN main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier::callback_executors: State Change ignored as there is no state change URL provided for interaction
2025-01-31T12:05:27.891579Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier: State Change: "ProviderState { name: "I have a list of libraries", params: {} }" -> Ok({})
2025-01-31T12:05:27.891588Z INFO main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier: Running provider verification for 'libraries/getLibraries/request'
2025-01-31T12:05:27.891599Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier: Verifying an asynchronous message (single shot)
2025-01-31T12:05:27.891627Z INFO main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier::provider_client: Sending request to provider at <http://localhost:50575>
2025-01-31T12:05:27.891630Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier::provider_client: Provider details = ProviderInfo { name: "LibrariesCore", protocol: "adsk_MessageBroker", host: "localhost", port: Some(50575), path: "", transports: [ProviderTransport { transport: "adsk_MessageBroker", port: Some(50575), path: None, scheme: None }] }
2025-01-31T12:05:27.891635Z INFO main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier::provider_client: Sending request HTTP Request ( method: POST, path: /, query: None, headers: Some({"Content-Type": ["application/json"]}), body: Present(105 bytes, application/json) )
2025-01-31T12:05:27.891641Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: pact_verifier::provider_client: body:
{"description":"libraries/getLibraries/request","providerStates":[{"name":"I have a list of libraries"}]}
2025-01-31T12:05:27.891693Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: log: starting new connection: <http://localhost:50575/>
2025-01-31T12:05:27.891743Z DEBUG tokio-runtime-worker hyper_util::client::legacy::connect::dns: resolving host="localhost"
2025-01-31T12:05:27.892523Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: hyper_util::client::legacy::connect::http: connecting to 127.0.0.1:50575
2025-01-31T12:05:27.892866Z DEBUG main verify_provider{provider_name="LibrariesCore"}:verify_interaction{interaction="libraries/getLibraries/request"}: hyper_util::client::legacy::connect::http: connected to 127.0.0.1:50575
it’s printing “Verifying an asynchronous message (single shot)”Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Feisal Ahmad
01/31/2025, 12:22 PMFeisal Ahmad
01/31/2025, 12:22 PMFeisal Ahmad
01/31/2025, 12:27 PMFeisal Ahmad
01/31/2025, 12:27 PMYousaf Nabi (pactflow.io)
Feisal Ahmad
01/31/2025, 12:37 PMFeisal Ahmad
01/31/2025, 12:38 PMFeisal Ahmad
01/31/2025, 12:38 PMYousaf Nabi (pactflow.io)
rholshausen
02/02/2025, 10:36 PMpact_verifier_cli --transport adsk_MessageBroker
and
plugin/pact-messagebroker/transport/application/adsk_MessageBroker
It looks like the plugin is registering the transport as application/adsk_MessageBroker
and not adsk_MessageBroker
Feisal Ahmad
02/03/2025, 11:44 AMapplication/adsk_MessageBroker
initially but for some reason I ended up removing the application/
part and saw it somehow seemed better? I’ll revisit this now I have a better understanding of thingsFeisal Ahmad
02/03/2025, 1:01 PMadsk_MessageBroker
everywhere since the cli doesn’t parse a transport name containing a /
in it, and added a simple HTTP server to accept the POST requests for state changes and now it continues to hit the plugin’s PrepareInteractionForVerification
rpc cool dogFeisal Ahmad
02/03/2025, 1:03 PMFeisal Ahmad
02/03/2025, 1:04 PM{
consumer: { name: 'PactMessageBrokerConsumerDSL.tst' },
interactions: [
{
description: 'libraries/getLibraries/request',
key: '75dee697cdd774dd',
pending: false,
request: [Object],
response: [Array],
transport: 'adsk_MessageBroker',
type: 'Synchronous/Messages'
}
],
metadata: {
pactRust: { ffi: '0.4.26', mockserver: '1.2.11', models: '1.2.5' },
pactSpecification: { version: '4.0' },
plugins: [ [Object] ]
},
provider: { name: 'LibrariesCore' }
}
Feisal Ahmad
02/03/2025, 1:07 PMbool pactffi_set_key(InteractionHandle interaction, const char *value);
but I can’t find any getter for itrholshausen
02/03/2025, 10:03 PMFeisal Ahmad
02/05/2025, 2:58 PMFeisal Ahmad
03/10/2025, 12:52 PM