46 lines
1.2 KiB
PowerShell
46 lines
1.2 KiB
PowerShell
# add-test-projects.ps1 - Add all test projects to StellaOps.Tests.sln
|
|
# Sprint: SPRINT_20251226_007_CICD
|
|
|
|
$ErrorActionPreference = 'Continue'
|
|
|
|
$slnPath = "src\StellaOps.Tests.sln"
|
|
$srcPath = "src"
|
|
|
|
Write-Host "=== Adding test projects to StellaOps.Tests.sln ==="
|
|
Write-Host "Solution: $slnPath"
|
|
|
|
# Find all test project files
|
|
$testProjects = Get-ChildItem -Path $srcPath -Recurse -Filter "*Tests.csproj" |
|
|
Where-Object {
|
|
$_.Name -notlike "*Testing.csproj" -and
|
|
$_.Name -notlike "*TestKit.csproj" -and
|
|
$_.FullName -notlike "*node_modules*" -and
|
|
$_.FullName -notlike "*bin*" -and
|
|
$_.FullName -notlike "*obj*"
|
|
}
|
|
|
|
Write-Host "Found $($testProjects.Count) test projects"
|
|
|
|
$added = 0
|
|
$failed = 0
|
|
|
|
foreach ($proj in $testProjects) {
|
|
$relativePath = $proj.FullName.Replace((Get-Location).Path + "\", "")
|
|
Write-Host "Adding: $relativePath"
|
|
|
|
$result = dotnet sln $slnPath add $proj.FullName 2>&1
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
$added++
|
|
} else {
|
|
Write-Host " Failed: $result" -ForegroundColor Yellow
|
|
$failed++
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Summary ==="
|
|
Write-Host "Added: $added"
|
|
Write-Host "Failed: $failed"
|
|
Write-Host "Total: $($testProjects.Count)"
|