Contract Testing for Suggested Reviewer integration with GitLab
As part of gitlab-org/modelops/applied-ml/review-recommender&3 (closed), an API will be created to integrate Suggested Reviewer with GitLab.
Contract tests should provide a suitable base for the test design and implementation.
The integration involves two communication channels with their distinct contracts, as depicted in the high-level design:
- GitLab -> SR via gRPC (blocked waiting for Pact gRPC support: https://pact.canny.io/feature-requests/p/support-grpc)
- GitLab backend -> GitLab frontend via GraphQL
SR -> GitLab via the GitLab API
We don't have existing examples of gRPC contract tests in our codebase, so some investigation will be necessary to implement them.
Tasks
Phase 1
-
Consider the requirements for contract testing services using gRPC (decided to wait for Pact to implement gRPC support) -
Create a simple test of the "GitLab backend -> GitLab frontend via GraphQL" contract and get feedback to confirm the approach is appropriate - Figure out how to implement contract tests for EE features.
-
Move relevant files in ee/folders -
Update Jest config to allow running consumer tests -
Make it possible to use licence helpers to run provider tests with licensed features stubbed.
-
- Figure out how to implement contract tests for EE features.
Phase 2
Note: This is blocked until Pact gRPC support is available: https://pact.canny.io/feature-requests/p/support-grpc
- Implement tests for the GitLab -> SR via gRPC communication channel
- Use the feedback received in Phase 1 to add additional tests to provide sufficient coverage
Edited by Mark Lapierre