diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index e03d176..d93e3c0 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -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