-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·36 lines (27 loc) · 1.27 KB
/
run.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env sh
# Get the API Gateway ID
restapi=$(aws --endpoint-url=http://localhost:4566 apigateway get-rest-apis | jq -r .items[0].id)
# Make the curl request and capture the response
response=$(curl -s -X POST "$restapi.execute-api.localhost.localstack.cloud:4566/local/test" -H 'content-type: application/json' -d '{ "input": "{}", "name": "MyExecution"}')
# Output the response for debugging purposes
echo "API Response: $response"
# Extract the execution ARN from the response
execution_arn=$(echo "$response" | jq -r .executionArn)
# Check if the execution ARN was extracted successfully
if [ -z "$execution_arn" ]; then
echo "Smoke test failed: Execution ARN not found in the response."
exit 1
fi
# Wait for 5 seconds before checking the status
sleep 5
# Describe the execution and capture the response
execution_response=$(awslocal stepfunctions describe-execution --execution-arn "$execution_arn")
# Output the execution response for debugging purposes
echo "Execution Response: $execution_response"
# Smoke test to validate the status
if echo "$execution_response" | jq -e '.status == "SUCCEEDED"' > /dev/null; then
echo "Smoke test passed: The execution status is 'SUCCEEDED'."
else
echo "Smoke test failed: The execution status is not 'SUCCEEDED'."
exit 1
fi