Files
mtusi2026lab5/student-tests/run-db-matrix.sh

12 lines
655 B
Bash
Executable File

#!/bin/sh
set -eu
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
GO=${GO:-go}
cd "$ROOT/backend"
gofmt -w internal/adapter/repository/postgres/pipeline_integration_test.go
CGO_ENABLED=0 "$GO" test -c -o "$ROOT/pipeline-db.test" ./internal/adapter/repository/postgres
cd "$ROOT"
"$ROOT/scripts/compose.sh" stop worker
trap '"$ROOT/scripts/compose.sh" up -d worker' EXIT
"$ROOT/scripts/compose.sh" run --rm --no-deps --entrypoint /pipeline-db.test -e RUN_PIPELINE_DB_TESTS=1 -v "$ROOT/pipeline-db.test:/pipeline-db.test:ro" worker -test.v -test.run '^Test(ReplayAfterCompletedPreviousVersionCleanup|VersionedPipelineDuplicateReorderRetryAndCleanup)$'