Hi, I have a question regarding verifying the Prov...
# general
b
Hi, I have a question regarding verifying the Provider Contract against dedicated dev environment. I am aware that provider contracts should be run against a locally running server, however I am wondering whether it's acceptable to run contract tests against an actual dev environment deployment if the local env setup is complex. The context is GraphQL API served by AWS Lambda, which also has AppSync (that may influence responses towards the consumer) and DynamoDB. To avoid this complex setup, idea is to create a CI/CD process which would: 1. Deploy latest provider version on non-live side of dev cluster 2. Run contract tests 3. If there are no violations of contract during can-i-deploy, do the actual Live switch Does this approach make sense?
👋 1
m
Yes it does. It’s not ideal for the reasons you are probably aware of, but if you can’t run it locally and test the behaviour you need, it’s better than not doing it at all
it would be worth exploring whether or not you could get it running locally (e.g. mocking dynamo/AWS behaviour) with enough fidelity to give you confidence
b
Thanks for a quick response! Yeah, I am not happy with doing it with a real environment, will try to explore if we can somehow mock it easily after all.
👍 1
s
I am interested in this approach as well. How can we make the tests run post-deployment on a dev environment?
m
What problem are you having trying that?
s
At this early stage, I don't know how to proceed with this. All the documentation on docs.pact.io point to running the tests pre-deployment as a unit test. Is there a guide that shows how we can run these tests after deployment?
m
Have you just tried it? The verifier doesn't care where your app is, you just give it the URL of where it's running
s
I'll give it a shot this week,
👍 1