Signal provisioning failures to fail the build fast.

There may be situations when Terraform/Ansible/etc. fail to provision test machines.
In these cases, we want to fail fast instead of waiting until we time out in circle-test-pre and circle-test-smoke.
This commit is contained in:
Marc CARRE committed 2017-02-08 14:15:59 +00:00
1 parent dd935b7e9e
commit a51bc6164c
3 files changed
+26 -6

No files matched your search

+8 -2
View File
@@ -2,6 +2,13 @@
set -e
# Signal failures in lock file, in order to fail fast:
function signal_failure() {
echo "KO" >"$TEST_VMS_READY_LOCK_FILE"
exit 1
}
trap signal_failure ERR
source "$STATE"
source "$(dirname "$0")/wait_for.sh"
@@ -16,9 +23,8 @@ if [ -n "$TEST_AND_PUBLISH" ]; then
wait_for 900 "$TEST_VMS_PROV_AND_CONF_LOCK_FILE"
# Upload built binaries to testing VMs:
rm -f "$TEST_VMS_READY_LOCK_FILE"
cd "$SRCDIR/test" # Ensures we generate Terraform state files in the right folder, for later use by integration tests.
./run-integration-tests.sh setup >>"$TEST_VMS_SETUP_OUTPUT_FILE" 2>&1
touch "$TEST_VMS_READY_LOCK_FILE"
echo "OK" >"$TEST_VMS_READY_LOCK_FILE"
echo "Test VMs now ready. $(date)." >>"$TEST_VMS_SETUP_OUTPUT_FILE"
fi