Files
git.stella-ops.org/devops/tools/test-lane.sh
2025-12-26 18:11:06 +02:00

36 lines
848 B
Bash

#!/usr/bin/env bash
# scripts/test-lane.sh
# Runs tests filtered by lane (Unit, Contract, Integration, Security, Performance, Live)
#
# Usage:
# ./scripts/test-lane.sh Unit
# ./scripts/test-lane.sh Integration --results-directory ./test-results
# ./scripts/test-lane.sh Security --logger "trx;LogFileName=security-tests.trx"
set -euo pipefail
LANE="${1:-Unit}"
shift || true
# Validate lane
case "$LANE" in
Unit|Contract|Integration|Security|Performance|Live)
;;
*)
echo "Error: Invalid lane '$LANE'. Must be one of: Unit, Contract, Integration, Security, Performance, Live"
exit 1
;;
esac
echo "Running tests for lane: $LANE"
# Build trait filter for xUnit
# Format: --filter "Lane=$LANE"
dotnet test \
--filter "Lane=$LANE" \
--configuration Release \
--no-build \
"$@"
echo "Lane '$LANE' tests completed"