Skip to content

Commit 3420198

Browse files
Add contract testing workflow
1 parent 47853ba commit 3420198

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/contract-testing.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
search-deployment: ${{ steps.filter.outputs.search-deployment }}
3131
stream-connection: ${{ steps.filter.outputs.stream-connection }}
3232
stream-instance: ${{ steps.filter.outputs.stream-instance }}
33+
stream-processor: ${{ steps.filter.outputs.stream-processor }}
3334
stream-workspace: ${{ steps.filter.outputs.stream-workspace }}
3435
steps:
3536
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
@@ -76,6 +77,8 @@ jobs:
7677
- 'cfn-resources/stream-connection/**'
7778
stream-instance:
7879
- 'cfn-resources/stream-instance/**'
80+
stream-processor:
81+
- 'cfn-resources/stream-processor/**'
7982
stream-workspace:
8083
- 'cfn-resources/stream-workspace/**'
8184
access-list-api-key:
@@ -855,6 +858,55 @@ jobs:
855858
pushd cfn-resources/stream-instance
856859
make create-test-resources
857860
cat inputs/inputs_1_create.json
861+
make run-contract-testing
862+
make delete-test-resources
863+
stream-processor:
864+
needs: change-detection
865+
if: ${{ needs.change-detection.outputs.stream-processor == 'true' }}
866+
runs-on: ubuntu-latest
867+
steps:
868+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
869+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
870+
with:
871+
go-version-file: 'cfn-resources/go.mod'
872+
- name: setup Atlas CLI
873+
uses: mongodb/atlas-github-action@e3c9e0204659bafbb3b65e1eb1ee745cca0e9f3b
874+
- uses: aws-actions/setup-sam@c2a20b1822cc4a6bc594ff7f1dbb658758e383c3
875+
with:
876+
use-installer: true
877+
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
878+
with:
879+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
880+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
881+
aws-region: eu-west-1
882+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
883+
with:
884+
python-version: '3.9'
885+
cache: 'pip' # caching pip dependencies
886+
- run: pip install cloudformation-cli cloudformation-cli-go-plugin
887+
- name: Run the Contract test
888+
shell: bash
889+
env:
890+
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
891+
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
892+
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
893+
MONGODB_ATLAS_OPS_MANAGER_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
894+
MONGODB_ATLAS_PROFILE: cfn-cloud-dev-github-action
895+
run: |
896+
cd cfn-resources/stream-processor
897+
make create-test-resources
898+
899+
cat inputs/inputs_1_create.json
900+
cat inputs/inputs_1_update.json
901+
cat inputs/inputs_2_create.json
902+
cat inputs/inputs_2_update.json
903+
cat inputs/inputs_3_create.json
904+
cat inputs/inputs_3_update.json
905+
cat inputs/inputs_4_create.json
906+
cat inputs/inputs_4_update.json
907+
cat inputs/inputs_5_create.json
908+
cat inputs/inputs_5_update.json
909+
858910
make run-contract-testing
859911
make delete-test-resources
860912
stream-workspace:

0 commit comments

Comments
 (0)