From 2e0ae6d8f2d87d1bcb0ff416ab39d3f0075e2ac2 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Tue, 15 Nov 2022 20:53:05 -0800 Subject: [PATCH] Redirect default install location in test to avoid using machine-wide install (#9230) * Redirect default install location in test to avoid using machine-wide install * Updated windows build image to Windows.10.vs2019.amd64 Co-authored-by: Sean Reeser --- azure-pipelines.yml | 2 +- eng/jobs/prepare-signed-artifacts.yml | 2 +- eng/jobs/windows-build.yml | 4 ++-- .../FrameworkResolution/MultipleHives.cs | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 27614efd86..642ffd02b3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -169,6 +169,6 @@ stages: dependsOn: PrepareSignedArtifacts pool: name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals build.windows.10.amd64.vs2017 + demands: ImageOverride -equals Windows.10.vs2019.amd64 - template: /eng/stages/publish.yml diff --git a/eng/jobs/prepare-signed-artifacts.yml b/eng/jobs/prepare-signed-artifacts.yml index f9ad024d6c..cbe1c11e6f 100644 --- a/eng/jobs/prepare-signed-artifacts.yml +++ b/eng/jobs/prepare-signed-artifacts.yml @@ -8,7 +8,7 @@ jobs: dependsOn: ${{ parameters.dependsOn }} pool: name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals build.windows.10.amd64.vs2017 + demands: ImageOverride -equals Windows.10.vs2019.amd64 # Double the default timeout. timeoutInMinutes: 120 workspace: diff --git a/eng/jobs/windows-build.yml b/eng/jobs/windows-build.yml index 8adea7c409..736a09ccc2 100644 --- a/eng/jobs/windows-build.yml +++ b/eng/jobs/windows-build.yml @@ -14,10 +14,10 @@ jobs: # Use a hosted pool when possible. ${{ if eq(variables['System.TeamProject'], 'public') }}: name: NetCore-Svc-Public - demands: ImageOverride -equals build.windows.10.amd64.vs2017.open + demands: ImageOverride -equals Windows.10.vs2019.amd64.open ${{ if ne(variables['System.TeamProject'], 'public') }}: name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals build.windows.10.amd64.vs2017 + demands: ImageOverride -equals Windows.10.vs2019.amd64 strategy: matrix: debug: diff --git a/src/test/HostActivation.Tests/FrameworkResolution/MultipleHives.cs b/src/test/HostActivation.Tests/FrameworkResolution/MultipleHives.cs index f15ed565cd..6fb12be76c 100644 --- a/src/test/HostActivation.Tests/FrameworkResolution/MultipleHives.cs +++ b/src/test/HostActivation.Tests/FrameworkResolution/MultipleHives.cs @@ -79,7 +79,10 @@ private CommandResult RunTest(Func runtimeConfig) SharedState.FrameworkReferenceApp, new TestSettings() .WithRuntimeConfigCustomizer(runtimeConfig) - .WithEnvironment(Constants.TestOnlyEnvironmentVariables.GloballyRegisteredPath, SharedState.DotNetGlobalHive.BinPath), + .WithEnvironment(Constants.TestOnlyEnvironmentVariables.GloballyRegisteredPath, SharedState.DotNetGlobalHive.BinPath) + .WithEnvironment( // Redirect the default install location to an invalid location so that a machine-wide install is not used + Constants.TestOnlyEnvironmentVariables.DefaultInstallPath, + System.IO.Path.Combine(SharedState.DotNetMainHive.BinPath, "invalid")), // Must enable multi-level lookup otherwise multiple hives are not enabled multiLevelLookup: true); }