pact-foundation / pact-net

.NET version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
842 stars 231 forks source link

Publish contracts to pact-broker using pactnet #474

Closed marek2209 closed 11 months ago

marek2209 commented 1 year ago

Is there are any way to publish contracts from code to pact broker. It seems like there is no such option. https://github.com/pact-foundation/pact_broker ?

YOU54F commented 1 year ago

No it was dropped in pact-net v4 when moving onto the rust core, meaning we didn't need to also add the legacy ruby executables, or recreate the functionality natively in .NET. The broker client functionality hasn't been ported to the rust core yet. It's a few api calls, so you could build some community based tooling.

https://github.com/pact-foundation/pact-net/blob/master/docs/upgrading-to-4.md#other-changes

mefellows commented 1 year ago

Our current recommendation is to use https://docs.pact.io/implementation_guides/cli#pact-cli

marek2209 commented 1 year ago

which workshop for pact-net on V3 is currently recommended to setup project cór scratch?

W dniu pt., 8.09.2023 o 06:51 Matt Fellows @.***> napisał(a):

Our current recommendation is to use https://docs.pact.io/implementation_guides/cli#pact-cli

— Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-net/issues/474#issuecomment-1711070669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFKTDX5RUF3OMICBRAWZTDXZKP4LANCNFSM6AAAAAA4L5PURI . You are receiving this because you authored the thread.Message ID: @.***>

YOU54F commented 1 year ago

See comments here

https://github.com/pact-foundation/pact-net/issues/398#issuecomment-1523208824

These have been updated

This one

https://github.com/DiUS/pact-workshop-dotnet-core-v3

has a PR to update it here

I've incorporated updates ones into here at the moment

https://github.com/you54f/pact-workshops

Hope that helps a little bit. We would always be happy for examples to be shared back with the community or updated, and happy to help out if you for example create a public repo, try things out and get stuck, its super easy for others to jump in and collab

marek2209 commented 1 year ago

should pact net use, database setup using testing containers framework or just provider state?

W dniu pt., 8.09.2023 o 18:01 Yousaf Nabi @.***> napisał(a):

See comments here

398 (comment)

https://github.com/pact-foundation/pact-net/issues/398#issuecomment-1523208824

These have been updated

This one

https://github.com/DiUS/pact-workshop-dotnet-core-v3

has a PR to update it here https://github.com/DiUS/pact-workshop-dotnet-core-v3/pulls

I've incorporated updates ones into here at the moment

https://github.com/you54f/pact-workshops

Hope that helps a little bit. We would always be happy for examples to be shared back with the community or updated, and happy to help out if you for example create a public repo, try things out and get stuck, its super easy for others to jump in and collab

— Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-net/issues/474#issuecomment-1711901589, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFKTDQ63OQV4K5ADHQSMQLXZM6OTANCNFSM6AAAAAA4L5PURI . You are receiving this because you authored the thread.Message ID: @.***>

mefellows commented 1 year ago

should pact net use, database setup using testing containers framework or just provider state?

This is unrelated to the current issue, probably best discussed elsewhere (e.g. SO, slack.pact.io #pact-net channel).

But TL;DR - Pact is agnostic to how you setup your state. Think of a state as a pre-condition for a test to pass, but it has not view on implementation of that.

adamrodger commented 11 months ago

The recommended way to publish pacts to the broker is using the Pact CLI tool linked above