Files
btcdata-archive/scripts/test-integration.sh
T
magnus d93735b3c5
test-and-build / test (push) Successful in 4m11s
test-and-build / build (push) Successful in 2m12s
Use supported Compose create flags for the CI test runner
2026-10-03 21:25:45 +02:00

18 lines
906 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
# Only disposable containers; no production connection settings or published ports.
export COMPOSE_PROJECT_NAME="btcdata-archive-test-${GITHUB_RUN_ID:-$$}-${GITHUB_RUN_ATTEMPT:-1}"
compose=(docker compose -f tests/integration/compose.yaml)
trap '"${compose[@]}" down -v' EXIT
"${compose[@]}" up -d postgres rustfs
"${compose[@]}" create tests
runner="$("${compose[@]}" ps -aq tests)"
# CI's workspace is inside its job container, not on the Docker host. Copy only
# test inputs; never bind-mount the workspace or copy .env, .git, or production secrets.
COPYFILE_DISABLE=1 tar -cf - requirements-test.lock src tests sql \
scripts/archive-old-weeks.sh scripts/list-archives.sh scripts/wait-test-infrastructure.py \
| docker cp - "$runner:/app"
docker start --attach "$runner"
exit "$(docker inspect --format '{{.State.ExitCode}}' "$runner")"