From d9bd92962b26089bde6c53188289035f73c97656 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 21 Jun 2024 07:55:53 +0200 Subject: [PATCH] Remove/restore problem matchers --- .../end-to-end-tests-dir/build-test-ports.ps1 | 2 ++ azure-pipelines/end-to-end-tests-dir/ci.ps1 | 4 ++++ azure-pipelines/end-to-end-tests-prelude.ps1 | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1 b/azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1 index b5068fc1c5..6223dffd7d 100644 --- a/azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1 @@ -38,7 +38,9 @@ if ($output -notmatch 'expected a versioning field') { throw 'Did not detect missing field' } +Remove-Problem-Matchers $output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/broken-manifests" install malformed +Restore-Problem-Matchers Throw-IfNotFailed if ($output -notmatch 'Trailing comma') { throw 'Did not detect malformed JSON' diff --git a/azure-pipelines/end-to-end-tests-dir/ci.ps1 b/azure-pipelines/end-to-end-tests-dir/ci.ps1 index 196effb8a8..8966c150b4 100644 --- a/azure-pipelines/end-to-end-tests-dir/ci.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/ci.ps1 @@ -30,14 +30,18 @@ $Output = Run-VcpkgAndCaptureOutput ci --dry-run --triplet=$Triplet --x-builtin- Throw-IfNotFailed # test malformed individual overlay port manifest +Remove-Problem-Matchers $Output = Run-VcpkgAndCaptureOutput ci --dry-run --triplet=$Triplet --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci/ci.baseline.txt" --overlay-ports="$PSScriptRoot/../e2e-ports/broken-manifests/malformed" +Restore-Problem-Matchers Throw-IfNotFailed if (-not ($Output.Contains("vcpkg.json:3:17: error: Trailing comma"))) { throw 'malformed port manifest must raise a parsing error' } # test malformed overlay port manifests +Remove-Problem-Matchers $Output = Run-VcpkgAndCaptureOutput ci --dry-run --triplet=$Triplet --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci/ci.baseline.txt" --overlay-ports="$PSScriptRoot/../e2e-ports/broken-manifests" +Restore-Problem-Matchers Throw-IfNotFailed if (-not ($Output.Contains("vcpkg.json:3:17: error: Trailing comma"))) { throw 'malformed overlay port manifest must raise a parsing error' diff --git a/azure-pipelines/end-to-end-tests-prelude.ps1 b/azure-pipelines/end-to-end-tests-prelude.ps1 index fe7e6095f2..82f1d62613 100644 --- a/azure-pipelines/end-to-end-tests-prelude.ps1 +++ b/azure-pipelines/end-to-end-tests-prelude.ps1 @@ -158,4 +158,17 @@ function Run-Vcpkg { Run-VcpkgAndCaptureOutput -ForceExe:$ForceExe @TestArgs | Out-Null } + +# https://github.com/ccc1028/gha-actions-toolkit/blob/main/docs/commands.md#problem-matchers +# .github/workflows/matchers.json +function Remove-Problem-Matchers { + Write-Host "::remove-matcher owner=vcpkg-msvc::" + Write-Host "::remove-matcher owner=vcpkg-gcc::" + Write-Host "::remove-matcher owner=vcpkg-catch::" +} +function Restore-Problem-Matchers { + Write-Host "::add-matcher::matchers.json" +} + + Refresh-TestRoot