Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at Pact consumer tests #89

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

wooly
Copy link
Contributor

@wooly wooly commented Jun 12, 2024

Description

To prevents the test splitter API from breaking its promise with the client, we are adding a contract testing using Pact.io. This PR replaces the server mocking in api package tests with Pact mock provider using pre-defined contract. This contract comes in the form of interactions containing information such as the expected request, the expected response, and a 'state' that the provider needs to be in to honour the interaction. These interactions can be generated as JSON file that can be used by test splitter API to verify that its behaviour doesn't break the contracts.

@wooly wooly changed the title First pass First pass at Pact consumer tests Jun 12, 2024
@@ -1 +1 @@
FROM public.ecr.aws/docker/library/golang:1.22.3@sha256:f43c6f049f04cbbaeb28f0aad3eea15274a7d0a7899a617d0037aec48d7ab010
FROM public.ecr.aws/docker/library/golang:1.21.11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pact-go doesn't work with go 1.22.x at the moment.
pact-foundation/pact-go#402

Linux x86_64 users

Using GoLang 1.22.x ?
Resolution: disable -race
Need to use -race?
Resolution: downgrade to 1.21.x

@nprizal nprizal force-pushed the tat-184-add-pact-for-integration-testing branch 3 times, most recently from 909977b to f0371b5 Compare June 13, 2024 04:41
@wooly wooly force-pushed the tat-184-add-pact-for-integration-testing branch from a6b32fe to 1dd8ff8 Compare June 16, 2024 23:06
@nprizal nprizal marked this pull request as ready for review June 16, 2024 23:17
@nprizal nprizal requested a review from a team as a code owner June 16, 2024 23:17
@wooly wooly merged commit f344e09 into main Jun 16, 2024
1 check passed
@wooly wooly deleted the tat-184-add-pact-for-integration-testing branch June 16, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants