Skip to content

Commit 1c804f0

Browse files
committed
fix issue with release body, use helper for running smoke test, use action to store pod
1 parent e43cf83 commit 1c804f0

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

.github/workflows/cloudpod_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
tag_name: "${{ inputs.release-tag || 'latest'}}"
5353
name: "Cloud Pod for LocalStack Version '${{ inputs.release-tag || 'latest'}}'"
54-
body-path: ./Release.txt
54+
body_path: ./Release.txt
5555
files: |
5656
./release-pod-mysql.zip
5757
./release-pod-mariadb.zip

.github/workflows/setup.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ jobs:
6363
make build
6464
make bootstrap
6565
make deploy
66-
67-
- name: Store Pod
68-
if: ${{ inputs.store-cloudpod == 'true' }}
66+
# TODO should we run smoke tests before creating the pod?
67+
- name: Run Smoke Tests
6968
run: |
70-
localstack pod save file://release-pod-${{ inputs.database-type }}.zip
69+
./test-helper/smoke-test.sh
70+
- name: Save the Cloud Pod
71+
if: ${{ inputs.store-cloudpod == 'true' }}
72+
uses: HarshCasper/cloud-pod-save-action@0.1.0
73+
with:
74+
name: 'release-pod-${{ inputs.database-type }}.zip'
75+
location: 'disk'
7176
- name: Upload Pod as Artifact
7277
if: ${{ inputs.store-cloudpod == 'true' }}
7378
uses: actions/upload-artifact@v3

test-helper/smoke-test.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# simple smoke test: runs two queries using the lambda that should be deployed
2+
# which connects to the database
3+
# it fails if the lambda cannot be called, or the database is not accessible/the tables are not available
4+
5+
awslocal lambda invoke --cli-binary-format raw-in-base64-out --function-name my-lambda-rds-query-helper --payload '{"sqlQuery": "show tables", "secretName":"/rdsinitexample/rds/creds/mysql-01"}' output1
6+
echo "show tables:"
7+
cat output1
8+
9+
awslocal lambda invoke --cli-binary-format raw-in-base64-out --function-name my-lambda-rds-query-helper --payload '{"sqlQuery": "select Author from Books", "secretName":"/rdsinitexample/rds/creds/mysql-01"}' output2
10+
echo "select Author from Books:"
11+
cat output2
12+
13+
14+
return_status1=$(cat output1 | jq -r .status)
15+
if [ "SUCCESS" != ${return_status1} ]; then
16+
echo "unexpected response for query1: ${return_status1}"
17+
cat output1
18+
exit 1
19+
fi
20+
21+
return_status2=$(cat output2 | jq -r .status)
22+
if [ "SUCCESS" != ${return_status2} ]; then
23+
echo "unexpected response for query2: ${return_status2}"
24+
cat output2
25+
exit 1
26+
fi

0 commit comments

Comments
 (0)