diff --git a/ports/librttopo/portfile.cmake b/ports/librttopo/portfile.cmake index 1024f3af5c390f..69b580b1d0c0f5 100644 --- a/ports/librttopo/portfile.cmake +++ b/ports/librttopo/portfile.cmake @@ -1,3 +1,5 @@ +message(FATAL_ERROR "SIMULATED BUILD ERROR. DO NOT MERGE") + # NOTE: update the version and checksum for new LIBRTTOPO release set(LIBRTTOPO_VERSION_STR "1.1.0") set(LIBRTTOPO_PACKAGE_SUM "d9c2f4db1261cc942152d348abb7f03e6053a63b6966e081c5381d40bbebd3c7ca1963224487355f384d7562a90287fb24d7af9e7eda4a1e230ee6441cef5de9") diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index ad50322393813b..3b0d41be46a95c 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -67,3 +67,12 @@ jobs: inputs: PathtoPublish: scripts/list_files ArtifactName: 'file lists for x64-linux' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: ne(variables['XML_RESULTS_FILE'], '') + inputs: + testRunTitle: x64-linux + testResultsFormat: xUnit + testResultsFiles: $(XML_RESULTS_FILE) + platform: x64-linux + configuration: static diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index a735d66df4656a..4647b17c9edbb7 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -70,3 +70,12 @@ jobs: inputs: PathtoPublish: scripts/list_files ArtifactName: 'file lists for x64-osx${{ variables.Postfix }}' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: ne(variables['XML_RESULTS_FILE'], '') + inputs: + testRunTitle: x64-osx + testResultsFormat: xUnit + testResultsFiles: $(XML_RESULTS_FILE) + platform: x64-osx + configuration: static diff --git a/scripts/azure-pipelines/process-test-results.ps1 b/scripts/azure-pipelines/process-test-results.ps1 new file mode 100644 index 00000000000000..723c78beb77f71 --- /dev/null +++ b/scripts/azure-pipelines/process-test-results.ps1 @@ -0,0 +1,38 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Process the raw xUnit result file from vcpkg tool for uploading to AZP. + +.DESCRIPTION +process-test-result takes the path a xUnit file generated by `vcpkg ci` and +modifies it in-place for reporting port builds as tests in Azure pipelines. + +.PARAMETER xunit +The path to the xUnit file. +#> +[CmdletBinding()] +Param( + [Parameter(Mandatory = $true)] + [string]$xunit +) + +if (-not(Test-Path $xunit)) { + write-error "No such file: $xunit" +} + +# Fix invalid XML +(Get-Content -Path $xunit -Raw) ` + -replace ' method="(Skip|Fail|Pass)">', ' result="$1">' ` + -replace '', '' | + Set-Content -Path $xunit + +[xml]$xmlContents = Get-Content $xunit +$node = $xmlContents.SelectSingleNode('/assemblies/assembly[@run-date="1970-01-01"]') +while ($null -ne $node) { + $node.ParentNode.RemoveChild($node) | Out-Null + $node = $xmlContents.SelectSingleNode('/assemblies/assembly[@run-date="1970-01-01"]') +} +$xmlContents.save($xunit) diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index dd8e25fdcab858..eafd295750ae61 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -116,6 +116,7 @@ else { } $failureLogs = Join-Path $ArtifactStagingDirectory 'failure-logs' +$xunitFile = Join-Path $ArtifactStagingDirectory "$Triplet-results.xml" if ($IsWindows) { @@ -162,7 +163,7 @@ if (($BuildReason -eq 'PullRequest') -and -not $NoParentHashes) # but changes must trigger at least some testing. Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake" Copy-Item "scripts/buildsystems/vcpkg.cmake" -Destination "scripts/test_ports/cmake-user" -& "./vcpkg$executableExtension" ci "--triplet=$Triplet" --failure-logs=$failureLogs "--ci-baseline=$PSScriptRoot/../ci.baseline.txt" @commonArgs @cachingArgs @parentHashes @skipFailuresArg +& "./vcpkg$executableExtension" ci "--triplet=$Triplet" --failure-logs=$failureLogs --x-xunit=$xunitFile "--ci-baseline=$PSScriptRoot/../ci.baseline.txt" @commonArgs @cachingArgs @parentHashes @skipFailuresArg $failureLogsEmpty = (-Not (Test-Path $failureLogs) -Or ((Get-ChildItem $failureLogs).count -eq 0)) Write-Host "##vso[task.setvariable variable=FAILURE_LOGS_EMPTY]$failureLogsEmpty" @@ -171,3 +172,6 @@ if ($LASTEXITCODE -ne 0) { throw "vcpkg ci failed" } + +& "$PSScriptRoot/process-test-results.ps1" -xunit $xunitFile +Write-Host "##vso[task.setvariable variable=XML_RESULTS_FILE]$xunitFile" diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index a456464383bdf5..a06da2a2c6d352 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -96,3 +96,12 @@ jobs: inputs: PathtoPublish: scripts/list_files ArtifactName: 'file lists for ${{ parameters.triplet }}' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: ne(variables['XML_RESULTS_FILE'], '') + inputs: + testRunTitle: ${{ parameters.triplet }} + testResultsFormat: xUnit + testResultsFiles: $(XML_RESULTS_FILE) + platform: ${{ parameters.triplet }} +