From f709125110eb4c58204ed19b3ee591497523d36d Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 28 Mar 2023 12:02:07 -0700 Subject: [PATCH] Error out if run-full-tests is run not inside a test container. --- .drone.yml | 2 ++ scripts/run-full-tests | 9 ++++++++- tests/end-to-end/docker-compose.yaml | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index cf4c358..354cff9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,6 +24,8 @@ clone: steps: - name: build image: alpine:3.13 + environment: + TEST_CONTAINER: true pull: always commands: - scripts/run-full-tests diff --git a/scripts/run-full-tests b/scripts/run-full-tests index cbd824c..bf26c21 100755 --- a/scripts/run-full-tests +++ b/scripts/run-full-tests @@ -8,7 +8,14 @@ # For more information, see: # https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/ -set -ex +set -e + +if [ -z "$TEST_CONTAINER" ] ; then + echo "This script is designed to work inside a test container and is not intended to" + echo "be run manually. If you're trying to run borgmatic's end-to-end tests, execute" + echo "scripts/run-end-to-end-dev-tests instead." + exit 1 +fi apk add --no-cache python3 py3-pip borgbackup postgresql-client mariadb-client mongodb-tools \ py3-ruamel.yaml py3-ruamel.yaml.clib bash sqlite diff --git a/tests/end-to-end/docker-compose.yaml b/tests/end-to-end/docker-compose.yaml index 090cf12..884edba 100644 --- a/tests/end-to-end/docker-compose.yaml +++ b/tests/end-to-end/docker-compose.yaml @@ -17,6 +17,8 @@ services: MONGO_INITDB_ROOT_PASSWORD: test tests: image: alpine:3.13 + environment: + TEST_CONTAINER: true volumes: - "../..:/app:ro" tmpfs: