Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tools/dotnet-test-cloud.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand All @@ -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
Expand All @@ -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 `
Expand Down
48 changes: 26 additions & 22 deletions tools/publish-CodeCov.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}