Matt (pactflow.io / pact-js / pact-go)
Daniel Talmor
06/27/2024, 9:23 AMMatt (pactflow.io / pact-js / pact-go)
1. Provider Test Environment: Do provider tests typically run against real service endpoints? We’re aiming to validate contracts against an environment that closely mirrors production, rather than a heavily mocked setup.real service, yes, usually with stubbed downstream dependecies (because otherwise you’re potentially straying back into functional e2e testing with all of the challenges. It’s also hard to manage provider states this way.
Matt (pactflow.io / pact-js / pact-go)
1. Data Availability: Given that consumer tests use mocks, how do we ensure the necessary data is available in the provider’s test environment? This seems crucial for meaningful contract validation.
see provider states
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
1. Best Practices for Data Setup: Could you outline best practices for preparing the test environment and data for provider tests? We’re particularly interested in strategies that balance realism with test isolation and repeatability.Similar to the above point.
Matt (pactflow.io / pact-js / pact-go)
1. Mocking vs. Real Services: Is there a general guideline on which components to mock and which to use real instances of during provider verification? How do we strike a balance between comprehensive testing and manageable test environments?This article talks about the “scope” which might help: https://docs.pact.io/getting_started/testing-scope
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
How do we strike a balance between comprehensive testing and manageable test environments?To reiterate this point: running pact tests against live environments is discouraged, because of the above point about unit tests, but also it really takes us a lot closer to e2e tests again - which is usually what we’ve been avoiding by setting up contract tests in the first place
Daniel Talmor
06/30/2024, 10:45 AM