mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 09:06:33 +00:00
[AZ-189] Simplify run-tests.sh
Made-with: Cursor
This commit is contained in:
+2
-31
@@ -1,33 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from e2e-consumer
|
||||||
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 ==="
|
|
||||||
|
|||||||
Reference in New Issue
Block a user