[AZ-189] Simplify run-tests.sh

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-16 07:04:13 +03:00
parent 3d665032e6
commit 63a26ac628
+2 -31
View File
@@ -1,33 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cleanup() {
echo "Cleaning up..."
docker compose -f "$PROJECT_ROOT/docker-compose.test.yml" down -v --remove-orphans 2>/dev/null || true
}
trap cleanup EXIT
UNIT_ONLY=false
for arg in "$@"; do
case "$arg" in
--unit-only) UNIT_ONLY=true ;;
esac
done
echo "=== Running unit tests ==="
cd "$PROJECT_ROOT"
dotnet restore
dotnet test Azaion.Test/ --configuration Release --verbosity normal --logger "console;verbosity=normal"
if [ "$UNIT_ONLY" = true ]; then
echo "=== Unit-only mode — skipping blackbox tests ==="
exit 0
fi
echo "=== Building and starting test environment ==="
docker compose -f "$PROJECT_ROOT/docker-compose.test.yml" up --build --abort-on-container-exit --exit-code-from e2e-consumer
echo "=== All tests passed ==="
cd "$(dirname "${BASH_SOURCE[0]}")/.."
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from e2e-consumer