Skip to content

santiagovm/pactnet-01

Repository files navigation

pact-net-01

Getting Started

create a .env file in the root, use .env.example as guidance

Contract Tests

based on:

Pact Matchers

  • .NET Matchers (link)

Pact Broker

  • CI/CD pipelines (link)
  • docs (link)
  • wiki (link)
  • dockerised pact broker (link)
  • docker compose sample (link)
  • pact publish script (powershell) (link)
  • pact cli (link)
  • publish docs (link)
  • can-i-deploy docs (link)
  • codecentric blog
    • Consumer-driven contract testing with Pact (link)
    • Message Pact – Contract testing in event-driven applications (link)
    • Implementing a consumer-driven contract testing workflow with Pact broker and GitLab CI (link)
  • publish provider verification results to a broker (link)
  • pactflow univeristy (link)
  • code samples (link)
  • videos
    • Pact tests: how we split up the monolithic deploy by Phil Hardwick (link)
    • Verifying Microservice Integrations with Contract Testing - Atlassian Summit 2016 (link)
    • microXchg 2017 - Alon Pe'er: Move Fast and Consumer Driven Contract Test Things (link)
    • YOW! 2017 Beth Skurrie - It's Not Hard to Test Smart: Delivering Customer Value Faster #YOW (link)
  • pending pacts (link 1 | link 2)

Pact Broker Webhooks

Pact Content Changed

curl --location --request POST 'https://dev.azure.com/santi-azure-devops-01/_apis/public/distributedtask/webhooks/pact_content_changed?api-version=6.1-preview' \
--header 'Content-Type: application/json' \
--header 'Cookie: VstsSession=%7B%22PersistentSessionId%22%3A%227b562f9d-f74e-4021-9f02-4f0c34da9870%22%2C%22PendingAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22CurrentAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22SignInState%22%3A%7B%7D%7D; X-VSS-UseRequestRouting=True' \
--data-raw '{
    "consumerPactUri": "https://vasquezhouse.pactflow.io/pacts/provider/Something%20API/consumer/My%20Consumer%20NUnit/latest/refs%2Fheads%2Fmain"
}'

Pact Wiki

  • development workflow (link)
  • using pact where the consumer team is different from the provider team (link)
  • sharing pacts between consumer and provider (link)
  • other (link)

API Integration Tests

Configuration via Environment Variables

Based on dotnet-env (link 1 | link 2)

Terraforming

Azure Pipelines

  • Predefined variables (link)
  • Set variables in the pipeline (link)
  • Service Containers (link)
  • Trigger pipeline via webhooks (link)

OpenAPI Specification

Generate OpenAPI Spec file

dotnet swagger tofile provider/provider/bin/Debug/netcoreapp3.1/provider.dll "v1"
dotnet swagger --output dist/oas.json tofile provider/provider/bin/Debug/netcoreapp3.1/provider.dll "v1"

About

Pact Kata in .NET projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages