Refactor NuGet package handling across multiple CI runners and documentation. Update paths to use .nuget/packages instead of local-nugets. Enhance README files for clarity on usage and environment setup. Add script to automate the addition of test projects to the solution.
This commit is contained in:
45
devops/scripts/add-test-projects.ps1
Normal file
45
devops/scripts/add-test-projects.ps1
Normal file
@@ -0,0 +1,45 @@
|
||||
# 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)"
|
||||
Reference in New Issue
Block a user