Hi All, We are setting up contract test for kafka ...
# pact-net
m
Hi All, We are setting up contract test for kafka events for a dotnet project and going through https://github.com/pact-foundation/pact-net/blob/master/docs/messaging-pacts.md to setup Provider test. I am able to verify the result but dont know how to publish the result without swagger file. For APi Contract testing we are running this command to publish the result.
Copy code
publish_provider_contract:
	@echo "\n========== STAGE: publish-provider-contract (spec + results) ==========\n"
	${PACTFLOW_CLI_COMMAND} publish-provider-contract \
	${OAS_PATH} \
     --provider ${PACTICIPANT} \
     --provider-app-version ${VERSION} \
     --branch ${BRANCH} \
     --content-type application/xml \
     --verification-exit-code=0 \
     --verification-results './report.xml' \
     --verification-results-content-type ${REPORT_FILE_CONTENT_TYPE}\
     --verifier xunit
where OAS_PATH is the swagger path. Can someone help me how to publish the verification result without Swagger file
b
Hey @Megha Agarwal , I think you’re mixing up two concepts here: publishing provider contracts (which you do when you’re doing bidirectional contract testing) and publishing provider verification results (which is typically part of consumer-driven contract testing). Which of these are you trying to do? https://www.ontestautomation.com/approaches-to-contract-testing/
m
I am doing bidirectional contract testing
b
OK. That means you don’t publish the contract verification result, that’s determined by PactFlow. You can publish additional (unit, integration) test results as some sort of audit trail but not without a contract. There is no point in doing that, PactFlow doesn’t even know how to parse those additional test results, so without a contract you’re essentially publishing nothing. If the provider creates the verification results, you’re not doing bidirectional contract testing.
☝️ 1
m
BDCT currently only works with OAS documents on the provider side, so you can’t do Kafka / Messaging with BDCT (unless that could be expressed as an OAS, which… probably it can’t without bending the rules)
We are currently investigating how to support asyc/messaging in BDCT. We just completed a design sprint, but need to do some additional user testing / validation. If you’re interested in sharing your use case and validating some concepts, DM me and we can setup a chat
m
Hi Matt and Bas, Thanks for the reply. I have DMed u
👍 1