Skip to content

Commit 523a634

Browse files
committed
Test regressions of independent ports
1 parent 0477c5f commit 523a634

File tree

7 files changed

+67
-2
lines changed

7 files changed

+67
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "regression",
3+
"version": "1",
4+
"dependencies": [
5+
{
6+
"name": "feature-fails",
7+
"features": [
8+
"fail"
9+
]
10+
}
11+
]
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "regression",
3+
"version": "2",
4+
"dependencies": [
5+
{
6+
"name": "feature-fails",
7+
"features": [
8+
"fail"
9+
]
10+
}
11+
]
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
if("fail" IN_LIST FEATURES)
3+
message(FATAL_ERROR "Failing, triggered by feature 'fail'.")
4+
endif()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "feature-fails",
3+
"version": "1",
4+
"features": {
5+
"fail": {
6+
"description": "fails to build"
7+
}
8+
}
9+
}

azure-pipelines/end-to-end-tests-dir/ci.ps1

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if (-not ($Output.Contains("feature-not-sup:${Triplet}: *"))) {
1717
if (-not ($Output.Contains("feature-dep-missing:${Triplet}: *"))) {
1818
throw 'feature-dep-missing must be built because the broken feature is not selected.'
1919
}
20-
if ($Output.Split("*").Length -ne 4) {
21-
throw 'base-port should not be installed for the host'
20+
if ($Output.Split("*: ").Length -ne 5) {
21+
throw 'Exactly 4 ports should be installed'
2222
}
2323
if (-not ($ErrorOutput.Contains("REGRESSION: not-sup-host-b:${Triplet} is marked as fail but not supported for ${Triplet}."))) {
2424
throw "feature-not-sup's baseline fail entry should result in a regression because the port is not supported"
@@ -80,10 +80,36 @@ Throw-IfFailed
8080
if (-not ($Output.Contains("base-port:${Triplet}: SUCCEEDED:"))) {
8181
throw 'base-port build must succeed'
8282
}
83+
if (-not ($Output.Contains("feature-fails:${Triplet}: SUCCEEDED:"))) {
84+
throw 'feature-fails[core] build must succeed'
85+
}
8386
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
8487
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
8588
$Output = Run-VcpkgAndCaptureOutput ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource="clear;files,$ArchiveRoot" --parent-hashes="$TestingRoot/parent-hashes.json"
8689
Throw-IfFailed
8790
if ($Output.Contains("base-port:${Triplet}: SUCCEEDED:")) {
8891
throw 'base-port must not be rebuilt again'
8992
}
93+
94+
# With parent-hashes, test detection of regressions of independent ports.
95+
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
96+
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
97+
Remove-Item -Recurse -Force $ArchiveRoot -ErrorAction SilentlyContinue
98+
New-Item -ItemType Directory -Path $ArchiveRoot -Force | Out-Null
99+
# A dry run in order to determine all parent hashes without failing, regression@1
100+
$Output = Run-VcpkgAndCaptureOutput ci --dry-run @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource="clear;files,$ArchiveRoot" --output-hashes="$TestingRoot/parent-hashes.json" --overlay-ports="$PSScriptRoot/../e2e-ports/ci-independent-regression/v1"
101+
Throw-IfFailed
102+
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
103+
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
104+
# Non-dry run with port regression@2
105+
$Output = Run-VcpkgAndCaptureOutput ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource="clear;files,$ArchiveRoot" --parent-hashes="$TestingRoot/parent-hashes.json" --overlay-ports="$PSScriptRoot/../e2e-ports/ci-independent-regression/v2"
106+
Throw-IfNotFailed
107+
if ($Output.Contains("base-port:${Triplet}: SUCCEEDED:")) {
108+
throw 'base-port must not be rebuilt again'
109+
}
110+
if (-not ($Output.Contains("feature-fails:${Triplet}: BUILD_FAILED:"))) {
111+
throw 'feature-fails[fail] build must fail'
112+
}
113+
if (-not ($Output.Contains("regression:${Triplet}: CASCADED_DUE_TO_MISSING_DEPENDENCIES:"))) {
114+
throw 'regression build must cascade'
115+
}

0 commit comments

Comments
 (0)