mirror of
https://github.com/azaion/missions.git
synced 2026-06-21 22:11:06 +00:00
3398ec49a0
ci/woodpecker/push/build-arm Pipeline was successful
- Updated Azaion.Missions.csproj to exclude test sources from service compilation, preventing build failures due to test project dependencies. - Modified docker-compose.test.yml to preload the pg_stat_statements extension for testing and adjusted JWT refresh intervals for better test execution timing. - Enhanced Dockerfile to install wget for health checks and ensure proper initialization of the container. - Introduced a test-only endpoint for JWKS refresh to facilitate end-to-end testing without relying on the default refresh intervals. - Updated DTOs in ApiDtos.cs to reflect camelCase naming conventions for consistency with service responses. - Improved test cases to handle JWKS rotation and refresh scenarios effectively, ensuring robust validation of JWT handling. This commit lays the groundwork for more reliable and efficient testing of the Azaion.Missions project.
58 lines
2.3 KiB
Bash
Executable File
58 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
## e2e-consumer entrypoint.
|
|
## 1. Run xUnit suite with TRX + console loggers.
|
|
## 2. Convert TRX -> the flat CSV documented in environment.md § Reporting.
|
|
## 3. Propagate the test exit code.
|
|
##
|
|
## Failure surface:
|
|
## - dotnet test returns non-zero on any test failure.
|
|
## - The CSV step still runs so the report captures whatever DID execute.
|
|
## - Final exit code is the dotnet test exit code (CSV failures are logged
|
|
## but do NOT mask test failures).
|
|
set -eu
|
|
|
|
# Register any CA certificates mounted into /usr/local/share/ca-certificates/
|
|
# with the system trust store. The compose file mounts jwks-mock's self-signed
|
|
# CA so the test client (HttpClient inside dotnet test) can validate the mock's
|
|
# TLS chain when calling https://jwks-mock:8443/sign or /rotate-key.
|
|
# Mirrors docker-entrypoint.sh in the missions service image.
|
|
if command -v update-ca-certificates >/dev/null 2>&1; then
|
|
update-ca-certificates --fresh >/dev/null 2>&1 || true
|
|
fi
|
|
|
|
mkdir -p "$RESULTS_DIR"
|
|
|
|
set +e
|
|
## Performance scenarios (Category=Perf) are excluded from the default gate
|
|
## per AZ-586. They are invoked from scripts/run-performance-tests.sh which
|
|
## passes its own --filter Category=Perf. ResLim tests (Category=ResLim) stay
|
|
## in the default gate because their docker-CLI gate causes them to skip
|
|
## with an explicit reason when COMPOSE_RESTART_ENABLED is not set.
|
|
TEST_FILTER="${TEST_FILTER:-Category!=Perf}"
|
|
dotnet test /src/Azaion.Missions.E2E.Tests.csproj \
|
|
--no-build \
|
|
--configuration Release \
|
|
--filter "$TEST_FILTER" \
|
|
--logger "trx;LogFileName=results.trx" \
|
|
--logger "console;verbosity=normal" \
|
|
--results-directory "$RESULTS_DIR"
|
|
TEST_EXIT=$?
|
|
set -e
|
|
|
|
TRX_FILE="$RESULTS_DIR/results.trx"
|
|
CSV_FILE="$RESULTS_DIR/report.csv"
|
|
TEST_DLL="/src/bin/Release/net10.0/Azaion.Missions.E2E.Tests.dll"
|
|
|
|
if [ -f "$TRX_FILE" ]; then
|
|
if dotnet /app/cli/Azaion.Missions.E2E.Reporting.Cli.dll "$TRX_FILE" "$CSV_FILE" "$TEST_DLL"; then
|
|
echo "[entrypoint] CSV report at $CSV_FILE"
|
|
else
|
|
cli_exit=$?
|
|
echo "[entrypoint] WARNING: trx -> csv conversion exited $cli_exit; tests still report their own verdict." >&2
|
|
fi
|
|
else
|
|
echo "[entrypoint] WARNING: $TRX_FILE not found; xUnit may not have produced any results." >&2
|
|
fi
|
|
|
|
exit "$TEST_EXIT"
|