-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow overrides to select ports that aren't in the baseline. (#1109)
* Add an e2e test for removed-from-baseline ports. * Rename patterns.ps1 to e2e-registry.ps1, to reflect that there are tests for more than just patterns now. * Add removed.json.in and a call to it. See also #1108 which fixes all the e2e infrastructure to consistently use -s. * Actually fix the bug: anything accepting both an ActionPlan and a PortFileProvider is suspect. In this case it was: ``` void load_tag_vars(const ActionPlan& action_plan, const PortFileProvider& port_provider, Triplet host_triplet) const; ``` Fix that by just pushing the ActionPlan part down to the underlying virtual load_tag_vars.
- Loading branch information
1 parent
f19f3d9
commit d89474b
Showing
32 changed files
with
94 additions
and
90 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
...pelines/e2e_registry/ports/foo/vcpkg.json → ...pelines/e2e-registry/ports/foo/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"description": "e2e test port" | ||
} | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"description": "e2e test port" | ||
} |
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e-registry/removed-ports/removed/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e-registry/removed-ports/removed/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "removed", | ||
"version": "1.0.0" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "9b82c31964570870d27a5bb634f5b84e13f8b90a", | ||
"version": "1.0.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
azure-pipelines/e2e_projects/e2e-registry-templates/removed.json.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"vcpkg-configuration": { | ||
"default-registry": { | ||
"kind": "git", | ||
"baseline": "$E2ERegistryBaseline", | ||
"repository": "$E2ERegistryPath" | ||
} | ||
}, | ||
"dependencies": [ | ||
"removed" | ||
], | ||
"overrides": [ | ||
{ | ||
"name": "removed", | ||
"version": "1.0.0" | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,18 @@ | |
try | ||
{ | ||
Copy-Item -Recurse -LiteralPath @( | ||
"$PSScriptRoot/../e2e_projects/registries-package-patterns", | ||
"$PSScriptRoot/../e2e_registry" | ||
"$PSScriptRoot/../e2e_projects/e2e-registry-templates", | ||
"$PSScriptRoot/../e2e-registry" | ||
) $WorkingRoot | ||
|
||
$manifestRoot = "$WorkingRoot/registries-package-patterns" | ||
$e2eRegistryPath = "$WorkingRoot/e2e_registry".Replace('\', '\\') | ||
$manifestRoot = "$WorkingRoot/e2e-registry-templates" | ||
$e2eRegistryPath = "$WorkingRoot/e2e-registry".Replace('\', '\\') | ||
Push-Location $e2eRegistryPath | ||
### <Initialize registry> | ||
# Creates a git registry to run the e2e tests on | ||
try | ||
{ | ||
Write-Host "Initializing test registry" | ||
if (Test-Path "$e2eRegistryPath/.git") | ||
{ | ||
Remove-Item -Recurse -Force "$e2eRegistryPath/.git" | ||
} | ||
|
||
|
||
$gitConfig = @( | ||
'-c', 'user.name=Nobody', | ||
'-c', '[email protected]', | ||
|
@@ -42,6 +36,7 @@ try | |
} | ||
### </Initialize Registry> | ||
|
||
# Testing registries' package selection patterns | ||
function Update-VcpkgJson { | ||
param($PreReplacementName) | ||
$content = Get-Content -LiteralPath "$manifestRoot/$PreReplacementName" | ||
|
@@ -55,40 +50,54 @@ try | |
# [patterns] No patterns (no default) | ||
Write-Host "[patterns] No patterns (no default)" | ||
Update-VcpkgJson 'no-patterns.json.in' | ||
Run-Vcpkg -EndToEndTestSilent @commonArgs install | Out-Null | ||
Run-Vcpkg @commonArgs install | ||
Throw-IfFailed | ||
Refresh-TestRoot | ||
|
||
# [patterns] Patterns only (no default) | ||
Write-Host "[patterns] Patterns only (no default)" | ||
Update-VcpkgJson 'only-patterns.json.in' | ||
Run-Vcpkg -EndToEndTestSilent @commonArgs install | Out-Null | ||
Run-Vcpkg @commonArgs install | ||
Throw-IfFailed | ||
Refresh-TestRoot | ||
|
||
# [patterns] Patterns with default | ||
Write-Host "[patterns] Patterns with default" | ||
Update-VcpkgJson 'with-default.json.in' | ||
Run-Vcpkg -EndToEndTestSilent @commonArgs install | Out-Null | ||
Run-Vcpkg @commonArgs install | ||
Throw-IfFailed | ||
Refresh-TestRoot | ||
|
||
# [patterns] Repeated patterns | ||
Write-Host "[patterns] Repeated patterns" | ||
Update-VcpkgJson 'with-redeclaration.json.in' | ||
$out = Run-VcpkgAndCaptureOutput -EndToEndTestSilent @commonArgs install | ||
$out = Run-VcpkgAndCaptureOutput @commonArgs install | ||
Throw-IfFailed | ||
if ($out -notmatch "redeclarations will be ignored") | ||
{ | ||
$out | ||
throw "Expected warning about redeclaration" | ||
throw 'Expected warning about redeclaration' | ||
} | ||
|
||
Refresh-TestRoot | ||
|
||
# Testing that overrides can select ports that are removed from the baseline | ||
Write-Host "[removed] Removed from baseline" | ||
Update-VcpkgJson 'removed.json.in' | ||
$out = Run-VcpkgAndCaptureOutput @commonArgs install | ||
Throw-IfFailed | ||
if ($out -match 'error: the baseline does not contain an entry for port removed' -Or | ||
$out -notmatch 'The following packages will be built and installed:\s+removed:[^ ]+ -> 1.0.0 -- [^ ]+git-trees[\\/]9b82c31964570870d27a5bb634f5b84e13f8b90a' | ||
) | ||
{ | ||
throw 'Baseline removed port could not be selected with overrides' | ||
} | ||
|
||
Refresh-TestRoot | ||
} | ||
finally | ||
{ | ||
Remove-Item -Recurse -Force -LiteralPath @( | ||
"$WorkingRoot/registries-package-patterns", | ||
"$WorkingRoot/e2e_registry" | ||
"$WorkingRoot/e2e-registry-templates", | ||
"$WorkingRoot/e2e-registry" | ||
) -ErrorAction SilentlyContinue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.