Skip to content

CICD-329 · Consumer-driven contract testing ​

Encyclopedia · Advanced networking and API testing · All snippets

Previous · CICD-328 · Next · CICD-330

1. Where it fits ​

  • Placement CI consumer/provider test.
  • Prerequisites authorized test service, known endpoint or local fixture and the named test CLI.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
pytest -q tests/contracts/consumer
pytest -q tests/contracts/provider

3. How it works ​

Pytest discovers the selected test files or markers and returns a process exit status reflecting the test outcome.

4. Verify the result ​

The consumer generates pact files and the provider verifies those exact artifacts against its local fixture. Fail on mismatch before publishing verification.

Validation syntax-validated (Bash parse). Status definitions.