borgmatic/scripts/run-full-tests

32 lines
1.3 KiB
Bash
Executable file

#!/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-end-to-end-tests
#
# For more information, see:
# https://torsion.org/borgmatic/how-to/develop-on-borgmatic/
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-tests instead."
exit 1
fi
apk add --no-cache python3 py3-pip borgbackup postgresql17-client mariadb-client mongodb-tools \
py3-mongo py3-regex py3-ruamel.yaml py3-ruamel.yaml.clib py3-tox py3-yaml ruff sqlite uv bash \
fish
# Alpine doesn't package the InfluxDB client, so install it from a tarball.
wget -qO- https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.8.0-linux-amd64.tar.gz \
| tar xz -C /usr/bin ./influx
export SHELL=/bin/bash
export PATH="/root/.local/bin:$PATH"
uv tool install tox --with tox-uv
export COVERAGE_FILE=/tmp/.coverage
tox --workdir /tmp/.tox -e py311,py314 --sitepackages
tox --workdir /tmp/.tox --sitepackages -e end-to-end