Files
git.stella-ops.org/devops/tools/ci/run-concelier-attestation-tests.sh
2025-12-26 18:11:06 +02:00

47 lines
1.6 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
cd "$ROOT_DIR"
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1
# Restore once for the Concelier solution.
dotnet restore src/Concelier/StellaOps.Concelier.sln
# Build the two test projects with analyzers disabled to keep CI fast.
dotnet build src/Concelier/__Tests/StellaOps.Concelier.Core.Tests/StellaOps.Concelier.Core.Tests.csproj \
-c Release -p:DisableAnalyzers=true
dotnet build src/Concelier/__Tests/StellaOps.Concelier.WebService.Tests/StellaOps.Concelier.WebService.Tests.csproj \
-c Release -p:DisableAnalyzers=true
# Run filtered attestation tests; keep logs in TestResults.
RESULTS=TestResults/concelier-attestation
mkdir -p "$RESULTS"
core_log="$RESULTS/core.trx"
web_log="$RESULTS/web.trx"
set +e
dotnet test src/Concelier/__Tests/StellaOps.Concelier.Core.Tests/StellaOps.Concelier.Core.Tests.csproj \
-c Release --no-build --filter EvidenceBundleAttestationBuilderTests \
--logger "trx;LogFileName=$(basename "$core_log")" --results-directory "$RESULTS"
CORE_EXIT=$?
dotnet test src/Concelier/__Tests/StellaOps.Concelier.WebService.Tests/StellaOps.Concelier.WebService.Tests.csproj \
-c Release --no-build --filter InternalAttestationVerify \
--logger "trx;LogFileName=$(basename "$web_log")" --results-directory "$RESULTS"
WEB_EXIT=$?
set -e
if [[ $CORE_EXIT -ne 0 || $WEB_EXIT -ne 0 ]]; then
echo "Attestation test run failed: core=$CORE_EXIT web=$WEB_EXIT" >&2
exit 1
fi
echo "Attestation tests succeeded; results in $RESULTS"