Files
ez-api/test/integration.sh
zenfun d147f3ab04 test(integration): reorganize test structure and add runner script
- Move integration tests and mock upstream resources from `integration/` to `test/` directory.
- Add `test/integration.sh` script to orchestrate environment setup and test execution.
- Update build context in `docker-compose.integration.yml` to match new structure.
- Add documentation for local development and integration testing workflows in README.
2025-12-02 15:56:17 +08:00

21 lines
571 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Runs integration tests inside the ez-api repo (builds docker-compose + go test).
REPO_ROOT=$(cd -- "$(dirname -- "$0")"/.. && pwd)
compose_file="$REPO_ROOT/docker-compose.integration.yml"
echo "[integration] bringing up services..."
docker compose -f "$compose_file" up --build -d --wait
cleanup() {
echo "[integration] tearing down services..."
docker compose -f "$compose_file" down -v
}
trap cleanup EXIT
echo "[integration] running go test with integration tag..."
cd "$REPO_ROOT/test"
go test -tags=integration ./...