Skip to content

Commit eb444f7

Browse files
committed
Test regressions of independent ports
1 parent 23c4cf1 commit eb444f7

File tree

7 files changed

+64
-2
lines changed

7 files changed

+64
-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: 25 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"
@@ -93,3 +93,26 @@ if ($Output.Contains("base-port:${Triplet}: SUCCEEDED:")) {
9393
if ($Output.Contains("feature-fails:${Triplet}: SUCCEEDED:")) {
9494
throw 'feature-fails must not be rebuilt again'
9595
}
96+
97+
# With parent-hashes, test detection of regressions of independent ports.
98+
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
99+
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
100+
Remove-Item -Recurse -Force $ArchiveRoot -ErrorAction SilentlyContinue
101+
New-Item -ItemType Directory -Path $ArchiveRoot -Force | Out-Null
102+
# A dry run in order to determine all parent hashes without failing, regression@1
103+
$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"
104+
Throw-IfFailed
105+
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
106+
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
107+
# Non-dry run with port regression@2
108+
$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"
109+
Throw-IfNotFailed
110+
if ($Output.Contains("base-port:${Triplet}: SUCCEEDED:")) {
111+
throw 'base-port must not be rebuilt again'
112+
}
113+
if (-not ($Output.Contains("feature-fails:${Triplet}: BUILD_FAILED:"))) {
114+
throw 'feature-fails[fail] build must fail'
115+
}
116+
if (-not ($Output.Contains("regression:${Triplet}: CASCADED_DUE_TO_MISSING_DEPENDENCIES:"))) {
117+
throw 'regression build must cascade'
118+
}

0 commit comments

Comments
 (0)