Run end-to-end tests on developer machines with Docker Compose for approximate parity with continuous integration tests.

This commit is contained in:
Dan Helfman
2019-12-11 16:43:01 -08:00
parent 0cc711173a
commit 464ff2fe96
9 changed files with 106 additions and 25 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# This script is for running all tests, including end-to-end tests, on a developer machine. It sets
# up database containers to run tests against, runs the tests, and then tears down the containers.
#
# Run this script from the root directory of the borgmatic source.
#
# For more information, see:
# https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/
set -e
docker-compose --file tests/end-to-end/docker-compose.yaml up --abort-on-container-exit
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# This script installs test dependencies and runs all tests, including end-to-end tests. It
# is designed to run inside a test container, and presumes that other test infrastructure like
# databases are already running. Therefore, on a developer machine, you should not run this script
# directly. Instead, run scripts/run-full-dev-tests
#
# For more information, see:
# https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/
set -e
python -m pip install --upgrade pip==19.3.1
pip install tox==3.14.0
tox
apk add --no-cache borgbackup postgresql-client mariadb-client
working_directory="$PWD"
adduser --disabled-password tests
su - tests --command "cd $working_directory && tox --workdir /tmp -e end-to-end"
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
# This script is intended to be run from the continuous integration build
# server, and not on a developer machine. For that, see:
# https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/
set -e
python -m pip install --upgrade pip==19.3.1
pip install tox==3.14.0
tox
apk add --no-cache borgbackup postgresql-client
tox -e end-to-end