Skip to main content
1 of 2

contract testing when separate frontend and backend repos

we are using a code pipeline for our CI-CD.

Front-end and back-end are separate repositories.

We run cypress end-to-end tests on the deployment of both frontend and backend.

The code gets merged from feature branch ->dev ->staging->prod and starts respective pipelines.

I am looking to integrate contract testing. We already have swagger documentation generated/stored when the API gateway is deployed.

I am thinking that to simulate consumer-driven contract testing, at the end of successful execution of end 2 end tests on the deployment of either frontend or backend, I will get a download of the swagger JSON doc from API gateway and store it in an s3 bucket so that I can use it as a reference to detect breaking changes on dev/staging stage.

Should I be comparing dev and staging to prod to detect breaking changes? I don't like to idea of referring to JSON from an s3 bucket in the prod account while deploying to dev or staging.

How can I refine this process? What are my options?

I know everyone seems to be using pact for contract testing but I just think it's overkill when we already have the swagger api docs.