Skip to content

Commit

Permalink
Remove/restore problem matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Jun 21, 2024
1 parent b3977f0 commit d9bd929
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions azure-pipelines/end-to-end-tests-prelude.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d9bd929

Please sign in to comment.