Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): do not overwrite pact file on every test #810

Conversation

individual-it
Copy link
Contributor

✈️ Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

📝 Summary

When overwriting is set to True only the last test-case from that file is saved in the JSON file and the provider side only executes that one test and not all interactions.

🔥 Motivation

run all examples and learn from them

🔨 Test Plan

  1. execute examples/tests/v3/test_00_consumer.py before the change
  2. expect the count of interactions in examples/pacts/v3_http_consumer-v3_http_provider.json => 1
  3. apply the change
  4. execute examples/tests/v3/test_00_consumer.py
  5. expect the count of interactions in examples/pacts/v3_http_consumer-v3_http_provider.json => 4
  6. execute test_01_fastapi_provider.py
  7. with fix and improve examples docker compose file #808 run hatch run example

the overwrite caused only the last test-case to be saved as interaction
in the pact JSON file
@JP-Ellis
Copy link
Contributor

JP-Ellis commented Oct 7, 2024

Amazing thanks for catching this oversight!

@JP-Ellis JP-Ellis merged commit 75ad5d4 into pact-foundation:master Oct 7, 2024
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants