Hi all I'm wondering if anyone has time for a quic...
# pactflow
p
Hi all I'm wondering if anyone has time for a quick chat or can answer a couple questions; I work at Heidi Health and we'd like to integrate pact for contract testing I'm wondering about using pact, and I'm confused as to if we have to spin up our running BE in order to validate FE pacts against it. This would mean we'd have to set state etc. I thought this goes against the principle of pact which is to avoid having to actually test against a live api.
👋 1
m
Can you elaborate a bit more on the setup you’re going for (and if our docs seem inconsistent). TL;DR - you always need to test a real BE, but normally you spin up the BE in a local, isolated environment (e.g. in dev, or a CI build) - not against a live environment (e.g. staging or production)
b
@Piripi Martin if you're still looking for someone to have a chat with, I'm happy to see if we can find a time that works for us. No strings attached. @Matt (pactflow.io / pact-js / pact-go) is right: the contract generated by the consumer (your FE) needs to be verified by an actual, running provider instance (your BE). That's the whole point of consumer-driven contract testing. You can mock downstream services, components and databases to make it more efficient, but the more realistic the provider setup the higher the chance the results will be representative. As an alternative you can consider bidirectional contract testing, where you verify a consumer contract against a provider spec (typically OpenAPI). This is a PactFlow-only feature. It’s much easier for the provider (no need to set up state, for example), but the downside is you verify against the provider spec, not the implementation.
thankyou 1