Skip to content

Commit 25561c5

Browse files
sivaram-mongodbsivaram-mongodbParthasarathyV
authored
feat: Update Search Index Resource (#1548)
Co-authored-by: sivaram-mongodb <sivaram@mongodb.com> Co-authored-by: ParthasarathyV <114770988+ParthasarathyV@users.noreply.github.com> Co-authored-by: ParthasarathyV <parthasarathy.varadhan@mongodb.com>
1 parent fe36e38 commit 25561c5

23 files changed

Lines changed: 1273 additions & 169 deletions

.github/workflows/contract-testing.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
project: ${{ steps.filter.outputs.project }}
3333
resource-policy: ${{ steps.filter.outputs.resource-policy }}
3434
search-deployment: ${{ steps.filter.outputs.search-deployment }}
35+
search-index: ${{ steps.filter.outputs.search-index }}
3536
stream-connection: ${{ steps.filter.outputs.stream-connection }}
3637
stream-instance: ${{ steps.filter.outputs.stream-instance }}
3738
stream-processor: ${{ steps.filter.outputs.stream-processor }}
@@ -86,6 +87,8 @@ jobs:
8687
- 'cfn-resources/resource-policy/**'
8788
search-deployment:
8889
- 'cfn-resources/search-deployment/**'
90+
search-index:
91+
- 'cfn-resources/search-index/**'
8992
stream-connection:
9093
- 'cfn-resources/stream-connection/**'
9194
stream-instance:
@@ -957,6 +960,46 @@ jobs:
957960
958961
cat inputs/inputs_1_create.json
959962
963+
make run-contract-testing
964+
make delete-test-resources
965+
search-index:
966+
needs: change-detection
967+
if: ${{ needs.change-detection.outputs.search-index == 'true' }}
968+
runs-on: ubuntu-latest
969+
steps:
970+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
971+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
972+
with:
973+
go-version-file: 'cfn-resources/go.mod'
974+
- name: setup Atlas CLI
975+
uses: mongodb/atlas-github-action@e3c9e0204659bafbb3b65e1eb1ee745cca0e9f3b
976+
- uses: aws-actions/setup-sam@c2a20b1822cc4a6bc594ff7f1dbb658758e383c3
977+
with:
978+
use-installer: true
979+
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
980+
with:
981+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
982+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
983+
aws-region: eu-west-1
984+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
985+
with:
986+
python-version: '3.9'
987+
cache: 'pip' # caching pip dependencies
988+
- run: pip install cloudformation-cli cloudformation-cli-go-plugin
989+
- name: Run the Contract test
990+
shell: bash
991+
env:
992+
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
993+
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
994+
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
995+
MONGODB_ATLAS_OPS_MANAGER_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
996+
MONGODB_ATLAS_PROFILE: cfn-cloud-dev-github-action
997+
run: |
998+
cd cfn-resources/search-index
999+
make create-test-resources
1000+
1001+
cat inputs/inputs_1_create.json
1002+
9601003
make run-contract-testing
9611004
make delete-test-resources
9621005
stream-connection:

cfn-resources/search-index/Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build test clean
1+
.PHONY: build debug clean create-test-resources delete-test-resources run-contract-testing
22
tags=logging callback metrics scheduler
33
cgo=0
44
goos=linux
@@ -17,3 +17,17 @@ debug:
1717

1818
clean:
1919
rm -rf bin
20+
21+
create-test-resources:
22+
@echo "==> Creating test files for contract testing"
23+
./test/contract-testing/cfn-test-create-inputs.sh
24+
25+
delete-test-resources:
26+
@echo "==> Delete test resources used for contract testing"
27+
./test/cfn-test-delete-inputs.sh
28+
29+
run-contract-testing:
30+
@echo "==> Run contract testing"
31+
make build
32+
sam local start-lambda &
33+
cfn test --function-name TestEntrypoint --verbose

cfn-resources/search-index/cmd/resource/config.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cfn-resources/search-index/cmd/resource/model.go

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)