Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ input_event_files=($(for file_name in ${input_event_files[@]}; do echo $file_nam
# Generate a random 8-character ID to avoid collisions with other runs
run_id=$(xxd -l 4 -c 4 -p < /dev/random)

# Always remove the stack before exiting, no matter what
function remove_stack() {
echo "Removing functions"
serverless remove --stage $run_id
}
trap remove_stack EXIT

echo "Deploying functions"
serverless deploy --stage $run_id

Expand Down Expand Up @@ -125,9 +132,6 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do
echo "Error from final attempt to retrieve logs:"
echo $raw_logs

echo "Removing functions"
serverless remove --stage $run_id

exit 1
fi

Expand Down Expand Up @@ -191,9 +195,6 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do
done
set -e

echo "Removing functions"
serverless remove --stage $run_id

if [ "$mismatch_found" = true ]; then
echo "FAILURE: A mismatch between new data and a snapshot was found and printed above."
echo "If the change is expected, generate new snapshots by running 'UPDATE_SNAPSHOTS=true DD_API_KEY=XXXX ./scripts/run_integration_tests.sh'"
Expand Down