File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ input_event_files=($(for file_name in ${input_event_files[@]}; do echo $file_nam
5555# Generate a random 8-character ID to avoid collisions with other runs
5656run_id=$( xxd -l 4 -c 4 -p < /dev/random)
5757
58+ # Always remove the stack before exiting, no matter what
59+ function remove_stack() {
60+ echo " Removing functions"
61+ serverless remove --stage $run_id
62+ }
63+ trap remove_stack EXIT
64+
5865echo " Deploying functions"
5966serverless deploy --stage $run_id
6067
@@ -125,9 +132,6 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do
125132 echo " Error from final attempt to retrieve logs:"
126133 echo $raw_logs
127134
128- echo " Removing functions"
129- serverless remove --stage $run_id
130-
131135 exit 1
132136 fi
133137
@@ -191,9 +195,6 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do
191195done
192196set -e
193197
194- echo " Removing functions"
195- serverless remove --stage $run_id
196-
197198if [ " $mismatch_found " = true ]; then
198199 echo " FAILURE: A mismatch between new data and a snapshot was found and printed above."
199200 echo " If the change is expected, generate new snapshots by running 'UPDATE_SNAPSHOTS=true DD_API_KEY=XXXX ./scripts/run_integration_tests.sh'"
You can’t perform that action at this time.
0 commit comments