Skip to content

Commit

Permalink
Move broken overlay ports into separate dir
Browse files Browse the repository at this point in the history
"e2e-ports/overlays" is in common vcpkg test args. It must not contain
broken ports if the the tool is expected to report broken overlay port
manifests. The tests which need these broken ports already passed an
explicit (and duplicate) "--overlay-ports" argument.
  • Loading branch information
dg0yt committed Jun 17, 2024
1 parent 2c36154 commit 00aab4d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
File renamed without changes.
14 changes: 10 additions & 4 deletions azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,33 @@ Run-Vcpkg @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install vcpkg
Throw-IfFailed
Run-Vcpkg @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install control-file
Throw-IfFailed
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/overlays" install broken-no-name
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/broken-ports" install broken-no-name
Throw-IfNotFailed
if ($output -notmatch "missing required field 'name'") {
throw 'Did not detect missing field'
}

$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/overlays" install broken-no-version
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/broken-ports" install broken-no-version
Throw-IfNotFailed
if ($output -notmatch 'expected a versioning field') {
throw 'Did not detect missing field'
}

$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/broken-ports" install malformed
Throw-IfNotFailed
if ($output -notmatch 'Trailing comma') {
throw 'Did not detect malformed JSON'
}

# Check for msgAlreadyInstalled vs. msgAlreadyInstalledNotHead
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install vcpkg-internal-e2e-test-port3
Throw-IfFailed
if ($output -notmatch 'vcpkg-internal-e2e-test-port3:[^ ]+ is already installed') {
throw 'Wrong already installed message'
throw 'Wrong already installed message'
}

$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install vcpkg-internal-e2e-test-port3 --head
Throw-IfFailed
if ($output -notmatch 'vcpkg-internal-e2e-test-port3:[^ ]+ is already installed -- not building from HEAD') {
throw 'Wrong already installed message for --head'
throw 'Wrong already installed message for --head'
}
12 changes: 6 additions & 6 deletions azure-pipelines/end-to-end-tests-dir/ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ if (-not ($Output.Contains("REGRESSION: dep-on-feature-not-sup:${Triplet} is mar
}

# test malformed port manifests
$Output = Run-VcpkgAndCaptureOutput ci --dry-run --triplet=$Triplet --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci-overlay" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci/ci.baseline.txt"
$Output = Run-VcpkgAndCaptureOutput ci --dry-run --triplet=$Triplet --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/broken-ports" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci/ci.baseline.txt"
Throw-IfNotFailed
if (-not ($Output.Contains("e2e-ports/ci-overlay/malformed/vcpkg.json:3:17: error:"))) {
if (-not ($Output.Contains("e2e-ports/broken-ports/malformed/vcpkg.json:3:17: error:"))) {
throw 'malformed port manifest must raise a parsing error'
}

# test malformed individual overlay port manifest
$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/ci-overlay/malformed"
$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-ports/malformed"
Throw-IfNotFailed
if (-not ($Output.Contains("e2e-ports/ci-overlay/malformed/vcpkg.json:3:17: error:"))) {
if (-not ($Output.Contains("e2e-ports/broken-ports/malformed/vcpkg.json:3:17: error:"))) {
throw 'malformed port manifest must raise a parsing error'
}

# test malformed overlay port manifests
$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/ci-overlay"
$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-ports"
Throw-IfNotFailed
if (-not ($Output.Contains("e2e-ports/ci-overlay/malformed/vcpkg.json:3:17: error:"))) {
if (-not ($Output.Contains("e2e-ports/broken-ports/malformed/vcpkg.json:3:17: error:"))) {
throw 'malformed overlay port manifest must raise a parsing error'
}

0 comments on commit 00aab4d

Please sign in to comment.