Hi , I am looking to do a POC for contract testing...
# pactflow-ama
s
Hi , I am looking to do a POC for contract testing with pact on a Frontend (Legacy Python Pyramid app: consumer) and a microservice (Python API). Because both consumer and provider are legacy apps, its not easy to bring them up locally to be able to perform consumer driven contract testing. So i read about Bi-directional contract testing where I can use the exisiting OpenAPi spec and a testing tool in provider side to create a contract and still implement contract testing workflow . I still just want to ask this question to this group to validate if this is the path i can take forward or am i missing something here ? Appreciate your help
y
Yeah that is a suitable use case, but still contains the caveats that the comparisons will be against the schemas, and thusly the onus is on the provider team to ensure they have sufficient coverage on the openapi definition they present
s
Hello @Yousaf Nabi (pactflow.io) I was able to present the approach to my team members and they have asked one question regarding using the consumer driven contract testing approach which i wanted to know your view also . My colleague: If its difficult to bring up the service locally in a CI server , can we use the tests and run them against the Staging version of the service? This way , pact tests can still tell us if the deployed version of the service on staging is compatible with the consumer or not and we can stop the deployment of that version to PROD. My response: We can run it but we are then not checking if the change made to the service already breaks the consumer in a local version and prevents it from deploying to STAGING. We will know about such issues only in STAGING which is not early .
chefkiss 1
hi @Yousaf Nabi (pactflow.io) just wanted to check if you can provide your insights into my question
👋 1
y
your response is correct, you could perform the tests against the running and deployed service, but this is reactive rather than proactive. by testing the providing service pre deployment you have confidence that the exposed routes will honour consumer expectations
it may be difficult to spin up the service locally, but this is something to consider as part of the testing approach. you may need to consider refactoring parts of your application to better support local running.
If i am in a team as a QA i would discuss the testing challenges and the problem we are trying to solve with contract testing. highlight the fact that this would be conducted largely as a development time exercise and as a QA i can get involved in the code review time rather than waiting for an application to be shipped. this closer collab between the QA and dev teams can lead dev teams to understand and propose solutions to making an app testable for your new contract testing use case
s
Awesome these are very helpful points . I will have a chat with my colleague about them for sure 👍