mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
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.
This commit is contained in:
20
test/integration.sh
Executable file
20
test/integration.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/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 ./...
|
||||
Reference in New Issue
Block a user