File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1465,6 +1465,21 @@ function Invoke-DotNetTest {
14651465
14661466 Write-StepHeader " Running Tests with Coverage" - Tags " Invoke-DotNetTest"
14671467
1468+ # Check if there are any test projects in the solution
1469+ $testProjects = @ (Get-ChildItem - Recurse - Filter " *.csproj" | Where-Object {
1470+ $_.Name -match " \.Test\.csproj$" -or
1471+ $_.Directory.Name -match " \.Test$" -or
1472+ $_.Directory.Name -eq " Test" -or
1473+ (Select-String - Path $_.FullName - Pattern " <IsTestProject>true</IsTestProject>" - Quiet)
1474+ })
1475+
1476+ if ($testProjects.Count -eq 0 ) {
1477+ Write-Information " No test projects found in solution. Skipping test execution." - Tags " Invoke-DotNetTest"
1478+ return
1479+ }
1480+
1481+ Write-Information " Found $ ( $testProjects.Count ) test project(s)" - Tags " Invoke-DotNetTest"
1482+
14681483 # Ensure the TestResults directory exists
14691484 $testResultsPath = Join-Path $CoverageOutputPath " TestResults"
14701485 New-Item - Path $testResultsPath - ItemType Directory - Force | Out-Null
You can’t perform that action at this time.
0 commit comments