Skip to content

Commit 3f33556

Browse files
committed
Test transitive cascade with --skip-failures
1 parent 181ca21 commit 3f33556

File tree

10 files changed

+83
-9
lines changed

10 files changed

+83
-9
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# fail means skip with --skip-failures
2+
always-skip:arm64-osx=fail
3+
always-skip:x64-linux=fail
4+
always-skip:x64-osx=fail
5+
always-skip:x64-windows=fail
6+
always-skip:x86-windows=fail
7+
8+
# fail means skip here, but cached artifacts exists
9+
maybe-skip:arm64-osx=fail
10+
maybe-skip:x64-linux=fail
11+
maybe-skip:x64-osx=fail
12+
maybe-skip:x64-windows=fail
13+
maybe-skip:x86-windows=fail
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# actual test
2+
always-skip:arm64-osx=skip
3+
always-skip:x64-linux=skip
4+
always-skip:x64-osx=skip
5+
always-skip:x64-windows=skip
6+
always-skip:x86-windows=skip
7+
8+
# don't build cached artifact
9+
maybe-transitive-cascade:arm64-osx=skip
10+
maybe-transitive-cascade:x64-linux=skip
11+
maybe-transitive-cascade:x64-osx=skip
12+
maybe-transitive-cascade:x64-windows=skip
13+
maybe-transitive-cascade:x86-windows=skip

azure-pipelines/e2e-assets/ci-skipped-ports/baseline.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "maybe-direct-cascade",
3+
"version": "1.0.0",
4+
"dependencies": [
5+
"maybe-skip"
6+
]
7+
}
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "maybe-skip",
3+
"version": "1.0.0"
4+
}
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(NOT EXISTS "${CURRENT_INSTALLED_DIR}/share/maybe-skip")
3+
message(FATAL_ERROR "Installation order violation")
4+
endif()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "maybe-transitive-cascade",
3+
"version": "1.0.0",
4+
"dependencies": [
5+
"maybe-direct-cascade"
6+
]
7+
}

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

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,55 @@ SUMMARY FOR $Triplet
9595

9696
# test that skipped ports aren't "put back" by downstream dependencies that aren't skipped
9797
Refresh-TestRoot
98-
$Output = Run-VcpkgAndCaptureOutput ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-assets/ci-skipped-ports" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci-skipped-ports/baseline.txt"
98+
$Output = Run-VcpkgAndCaptureOutput ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-assets/ci-skipped-ports" --binarysource="clear;files,$ArchiveRoot,readwrite" --ci-baseline="$PSScriptRoot/../e2e-assets/ci-skipped-ports/baseline.skip.txt"
9999
Throw-IfFailed
100100
if (-not ($Output -match 'always-built:[^:]+: \*:' -and $Output -match 'Building always-built:[^@]+@1\.0\.0\.\.\.')) {
101101
throw 'did not attempt to build always-built'
102102
}
103103
if (-not ($Output -match 'always-skip:[^:]+: skip\n')) {
104-
throw 'tried to build skipped'
104+
throw 'did not identify always-skip as skipped'
105+
}
106+
if (-not ($Output -match 'always-cascade:[^:]+ failed with: CASCADED_DUE_TO_MISSING_DEPENDENCIES\n')) {
107+
throw 'did not identify always-cascade as cascaded'
105108
}
106109
# This should be statically determinable but at the moment we do not
107110
# if (-not ($Output -match 'always-cascade:[^:]+: cascade\n')) {
108111
# throw 'tried to build cascaded'
109112
# }
110113
Throw-IfNonContains -Actual $Output -Expected @"
111114
SUMMARY FOR $Triplet
112-
SUCCEEDED: 1
115+
SUCCEEDED: 3
113116
CASCADED_DUE_TO_MISSING_DEPENDENCIES: 1
114-
EXCLUDED: 1
117+
EXCLUDED: 2
115118
"@
119+
# prerequisite for next test
120+
if (-not ($Output -match 'maybe-transitive-cascade:[^:]+: skip\n')) {
121+
throw 'did not identify maybe-transitive-cascade as skip'
122+
}
123+
# test with --skip-failures and cached artifacts
124+
Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
125+
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
126+
$Output = Run-VcpkgAndCaptureOutput ci --skip-failures @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-assets/ci-skipped-ports" --binarysource="clear;files,$ArchiveRoot" --ci-baseline="$PSScriptRoot/../e2e-assets/ci-skipped-ports/baseline.fail.txt"
127+
Throw-IfFailed
128+
if (-not ($Output -match 'always-built:[^:]+: cached:') -or $Output -match 'Building always-built:[^@]+@1\.0\.0\.\.\.') {
129+
throw 'did not reuse the cached artifact for always-built'
130+
}
131+
if (-not ($Output -match 'always-skip:[^:]+: skip\n')) {
132+
throw 'did not identify always-skip as skipped'
133+
}
134+
if (-not ($Output -match 'always-cascade:[^:]+ failed with: CASCADED_DUE_TO_MISSING_DEPENDENCIES\n')) {
135+
throw 'did not identify always-cascade as cascaded'
136+
}
137+
if (-not ($Output -match 'maybe-skip:[^:]+: skip\n')) {
138+
throw 'did not identify maybe-skip as skipped'
139+
}
140+
# not cached and transitive dependency on maybe-skip which is excluded
141+
if (-not ($Output -match 'maybe-transitive-cascade:[^:]+ failed with: CASCADED_DUE_TO_MISSING_DEPENDENCIES\n')) {
142+
throw 'did not identify maybe-transitive-cascade as cascaded'
143+
}
116144

117145
# test that features included only by skipped ports are not included
146+
Refresh-TestRoot
118147
$xunitFile = Join-Path $TestingRoot 'xunit.xml'
119148
Refresh-TestRoot
120149
Remove-Problem-Matchers

0 commit comments

Comments
 (0)