diff --git a/tools/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 index da876cb9..3d8d0870 100644 --- a/tools/dotnet-test-cloud.ps1 +++ b/tools/dotnet-test-cloud.ps1 @@ -43,7 +43,7 @@ if ($x86) { Write-Host "Running tests using `"$dotnet`"" -ForegroundColor DarkGray } else { Write-Error "Unable to find 32-bit dotnet.exe" - return 1 + exit 1 } } } @@ -61,7 +61,7 @@ if ($isMTP) { $dumpSwitches = @( ,'--hangdump' - ,'--hangdump-timeout','120s' + ,'--hangdump-timeout','5m' ,'--crashdump' ,'--crashdump-type','Heap' # The native crash report accompanies the dump and is often the only way to identify the @@ -84,10 +84,17 @@ if ($isMTP) { ) } - & $dotnet test --solution $RepoRoot ` + $solutionFiles = @(Get-ChildItem -LiteralPath $RepoRoot -File | Where-Object { $_.Extension -in '.sln', '.slnx' }) + if ($solutionFiles.Count -ne 1) { + throw "Expected exactly one solution file in $RepoRoot, but found $($solutionFiles.Count)." + } + + $solutionPath = $solutionFiles[0].FullName + & $dotnet test $solutionPath ` --no-build ` -c $Configuration ` -bl:"$testBinLog" ` + -- ` --filter-not-trait 'TestCategory=FailsInCloudTest' ` @mtpArgs ` @dumpSwitches ` diff --git a/tools/publish-CodeCov.ps1 b/tools/publish-CodeCov.ps1 index 2f9b85a6..d9bc81db 100644 --- a/tools/publish-CodeCov.ps1 +++ b/tools/publish-CodeCov.ps1 @@ -22,30 +22,34 @@ Param ( $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path $codeCovTool = & "$PSScriptRoot/Get-CodeCovTool.ps1" +$coverageFiles = @(Get-ChildItem -Recurse -LiteralPath $PathToCodeCoverage -Filter "*.cobertura.xml") +if ($coverageFiles.Count -eq 0) { + return +} -Get-ChildItem -Recurse -LiteralPath $PathToCodeCoverage -Filter "*.cobertura.xml" | % { - $relativeFilePath = Resolve-Path -relative $_.FullName - +$arguments = @( + "upload-process", + "--disable-search", + "--fail-on-error", + "-t", $CodeCovToken, + "--network-root-folder", $RepoRoot +) +foreach ($coverageFile in $coverageFiles) { + $relativeFilePath = Resolve-Path -Relative $coverageFile.FullName Write-Host "Uploading: $relativeFilePath" -ForegroundColor Yellow - $arguments = @( - "upload-process", - "--disable-search", - "--fail-on-error", - "-t", $CodeCovToken, - "-f", $relativeFilePath, - "--network-root-folder", $RepoRoot - ) - if ($Flags) { - $arguments += @("-F", $Flags) - } + $arguments += @("-f", $relativeFilePath) +} - if ($Name) { - $arguments += @("-n", $Name) - } +if ($Flags) { + $arguments += @("-F", $Flags) +} + +if ($Name) { + $arguments += @("-n", $Name) +} - & $codeCovTool $arguments - if ($LASTEXITCODE -ne 0) { - Write-Error "Codecov CLI failed with exit code $LASTEXITCODE." - exit $LASTEXITCODE - } +& $codeCovTool @arguments +if ($LASTEXITCODE -ne 0) { + Write-Error "Codecov CLI failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE }