@@ -135,40 +135,6 @@ function Invoke-External([string]$Label, [scriptblock]$Command) {
135135 }
136136}
137137
138- function Invoke-ParallelTests ([array ]$TestRuns , [string ]$Configuration , [string ]$RepoRoot ) {
139- if (-not $TestRuns -or $TestRuns.Count -eq 0 ) {
140- return
141- }
142-
143- $jobs = foreach ($testRun in $TestRuns ) {
144- Start-Job - Name $testRun.Label - ArgumentList $testRun.Project , $Configuration , $RepoRoot , $testRun.Label - ScriptBlock {
145- param ($project , $configuration , $repoRoot , $label )
146- Set-Location $repoRoot
147- dotnet test $project - c $configuration
148- $exitCode = $LASTEXITCODE
149- [pscustomobject ]@ { Label = $label ; ExitCode = $exitCode }
150- }
151- }
152-
153- $results = @ ()
154- foreach ($job in $jobs ) {
155- $jobOutput = Receive-Job - Job $job - Wait - AutoRemoveJob
156- foreach ($item in $jobOutput ) {
157- if ($item -is [pscustomobject ] -and $item.PSObject.Properties.Name -contains " ExitCode" ) {
158- $results += $item
159- } else {
160- Write-Host $item
161- }
162- }
163- }
164-
165- $failed = $results | Where-Object { $_.ExitCode -ne 0 }
166- if ($failed ) {
167- $failedLabels = ($failed | Select-Object - ExpandProperty Label) -join " , "
168- throw " Tests failed: $failedLabels ."
169- }
170- }
171-
172138try {
173139 if (-not $Fast -and -not $Full ) {
174140 $Fast = $true
@@ -226,22 +192,10 @@ try {
226192
227193 if (-not $SkipTests ) {
228194 Write-Section " Test"
229- if ($Full ) {
230- $repoRoot = (Get-Location ).Path
231- $testRuns = @ (
232- [pscustomobject ]@ {
233- Label = " Grace.CLI.Tests"
234- Project = " src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj"
235- },
236- [pscustomobject ]@ {
237- Label = " Grace.Server.Tests"
238- Project = " src/Grace.Server.Tests/Grace.Server.Tests.fsproj"
239- }
240- )
195+ Invoke-External " Grace.CLI.Tests" { dotnet test " src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj" - c $Configuration }
241196
242- Invoke-ParallelTests - TestRuns $testRuns - Configuration $Configuration - RepoRoot $repoRoot
243- } else {
244- Invoke-External " Grace.CLI.Tests" { dotnet test " src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj" - c $Configuration }
197+ if ($Full ) {
198+ Invoke-External " Grace.Server.Tests" { dotnet test " src/Grace.Server.Tests/Grace.Server.Tests.fsproj" - c $Configuration }
245199 }
246200 } else {
247201 Write-Section " Test"
0 commit comments