Files
ChatBot/run-coverage.ps1
Leonid Pershin b8fc79992a
All checks were successful
SonarQube / Build and analyze (push) Successful in 3m33s
fix covverage
2025-10-21 03:17:43 +03:00

18 lines
725 B
PowerShell

#!/usr/bin/env pwsh
# Script to run tests with code coverage
Write-Host "Running tests with code coverage..." -ForegroundColor Green
# Run tests with coverlet
dotnet test --collect:"XPlat Code Coverage" --results-directory:./TestResults
Write-Host "`nTest execution completed!" -ForegroundColor Green
Write-Host "Coverage results are in ./TestResults folder" -ForegroundColor Yellow
# Find the most recent coverage file
$coverageFiles = Get-ChildItem -Path "./TestResults" -Filter "coverage.cobertura.xml" -Recurse | Sort-Object LastWriteTime -Descending
if ($coverageFiles.Count -gt 0) {
Write-Host "`nCoverage file location:" -ForegroundColor Cyan
Write-Host $coverageFiles[0].FullName -ForegroundColor White
}