Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Reachability Corpus Validation / validate-corpus (push) Has been cancelled
Reachability Corpus Validation / validate-ground-truths (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Reachability Corpus Validation / determinism-check (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
96 lines
2.8 KiB
PowerShell
96 lines
2.8 KiB
PowerShell
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# QA-CORPUS-401-031: Deterministic runner for reachability corpus tests (Windows)
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(HelpMessage = "xUnit filter pattern (e.g., 'CorpusFixtureTests')")]
|
|
[string]$Filter,
|
|
|
|
[Parameter(HelpMessage = "Test verbosity level")]
|
|
[ValidateSet("quiet", "minimal", "normal", "detailed", "diagnostic")]
|
|
[string]$Verbosity = "normal",
|
|
|
|
[Parameter(HelpMessage = "Build configuration")]
|
|
[ValidateSet("Debug", "Release")]
|
|
[string]$Configuration = "Release",
|
|
|
|
[Parameter(HelpMessage = "Skip build step")]
|
|
[switch]$NoBuild
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$RepoRoot = (Resolve-Path (Join-Path $ScriptDir "..\..")).Path
|
|
$TestProject = Join-Path $RepoRoot "tests\reachability\StellaOps.Reachability.FixtureTests\StellaOps.Reachability.FixtureTests.csproj"
|
|
|
|
function Write-LogInfo { param($Message) Write-Host "[INFO] $Message" -ForegroundColor Green }
|
|
function Write-LogWarn { param($Message) Write-Host "[WARN] $Message" -ForegroundColor Yellow }
|
|
function Write-LogError { param($Message) Write-Host "[ERROR] $Message" -ForegroundColor Red }
|
|
|
|
Write-LogInfo "Reachability Corpus Test Runner (Windows)"
|
|
Write-LogInfo "Repository root: $RepoRoot"
|
|
Write-LogInfo "Test project: $TestProject"
|
|
|
|
# Verify prerequisites
|
|
$dotnetPath = Get-Command dotnet -ErrorAction SilentlyContinue
|
|
if (-not $dotnetPath) {
|
|
Write-LogError "dotnet CLI not found. Please install .NET SDK."
|
|
exit 1
|
|
}
|
|
|
|
# Verify corpus exists
|
|
$corpusManifest = Join-Path $RepoRoot "tests\reachability\corpus\manifest.json"
|
|
if (-not (Test-Path $corpusManifest)) {
|
|
Write-LogError "Corpus manifest not found at $corpusManifest"
|
|
exit 1
|
|
}
|
|
|
|
$reachbenchIndex = Join-Path $RepoRoot "tests\reachability\fixtures\reachbench-2025-expanded\INDEX.json"
|
|
if (-not (Test-Path $reachbenchIndex)) {
|
|
Write-LogError "Reachbench INDEX not found at $reachbenchIndex"
|
|
exit 1
|
|
}
|
|
|
|
# Build if needed
|
|
if (-not $NoBuild) {
|
|
Write-LogInfo "Building test project ($Configuration)..."
|
|
& dotnet build $TestProject -c $Configuration --nologo
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-LogError "Build failed"
|
|
exit $LASTEXITCODE
|
|
}
|
|
}
|
|
|
|
# Build test command arguments
|
|
$testArgs = @(
|
|
"test"
|
|
$TestProject
|
|
"-c"
|
|
$Configuration
|
|
"--no-build"
|
|
"--verbosity"
|
|
$Verbosity
|
|
)
|
|
|
|
if ($Filter) {
|
|
$testArgs += "--filter"
|
|
$testArgs += "FullyQualifiedName~$Filter"
|
|
Write-LogInfo "Running tests with filter: $Filter"
|
|
} else {
|
|
Write-LogInfo "Running all fixture tests..."
|
|
}
|
|
|
|
# Run tests
|
|
Write-LogInfo "Executing: dotnet $($testArgs -join ' ')"
|
|
& dotnet @testArgs
|
|
$exitCode = $LASTEXITCODE
|
|
|
|
if ($exitCode -eq 0) {
|
|
Write-LogInfo "All tests passed!"
|
|
} else {
|
|
Write-LogError "Some tests failed (exit code: $exitCode)"
|
|
}
|
|
|
|
exit $exitCode
|