浏览代码

Error out if run-full-tests is run not inside a test container.

Dan Helfman 2 年之前
父节点
当前提交
f709125110
共有 3 个文件被更改,包括 12 次插入1 次删除
  1. 2 0
      .drone.yml
  2. 8 1
      scripts/run-full-tests
  3. 2 0
      tests/end-to-end/docker-compose.yaml

+ 2 - 0
.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

+ 8 - 1
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

+ 2 - 0
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: