Provision and destroy test VMs in the background.

This should help speed-up the build by provisioning test VMs while we run unit tests, and destroying them while we generate coverage reports.
This commit is contained in:
Marc CARRE committed 2017-02-08 14:15:59 +00:00
1 parent 67dbdd377c
commit dd935b7e9e
7 files changed
+141 -48

No files matched your search

+17 -2
View File
@@ -3,7 +3,22 @@
set -e
source "$STATE"
source "$(dirname "$0")/wait_for.sh"
if [ -n "$TEST_AND_PUBLISH" ] ; then
cd $SRCDIR/test
if [ -n "$TEST_AND_PUBLISH" ]; then
[ -n "$SECRET_KEY" ] || {
echo "Cannot run smoke tests: no secret key"
exit 1
}
# Provisioning from image typically take 90 seconds,
# but if we are creating a GCP image, it can take more than 10 minutes:
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 "Test VMs now ready. $(date)." >>"$TEST_VMS_SETUP_OUTPUT_FILE"
fi