diff --git a/src/Test/L0/Worker/Build/BuildDirectoryManagerL0.cs b/src/Test/L0/Worker/Build/BuildDirectoryManagerL0.cs index 18e16b1f64..e370451f9c 100644 --- a/src/Test/L0/Worker/Build/BuildDirectoryManagerL0.cs +++ b/src/Test/L0/Worker/Build/BuildDirectoryManagerL0.cs @@ -347,6 +347,7 @@ private TestHostContext Setup( _variables.Set(Constants.Variables.System.DefinitionId, DefinitionId); _variables.Set(Constants.Variables.Build.Clean, $"{cleanOption}"); _ec.Setup(x => x.Variables).Returns(_variables); + _ec.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); // Store the expected tracking file path. _trackingFile = Path.Combine( diff --git a/src/Test/L0/Worker/Build/BuildJobExtensionL0.cs b/src/Test/L0/Worker/Build/BuildJobExtensionL0.cs index 557de3a36f..14348b2a09 100644 --- a/src/Test/L0/Worker/Build/BuildJobExtensionL0.cs +++ b/src/Test/L0/Worker/Build/BuildJobExtensionL0.cs @@ -274,6 +274,8 @@ private TestHostContext Setup([CallerMemberName] string name = "", x.SetVariable(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback((string varName, string varValue, bool isSecret, bool isOutput, bool isFilePath, bool isReadOnly, bool preserveCase) => { _variables.Set(varName, varValue, false); }); + _ec.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); + _extensionManager.Setup(x => x.GetExtensions()) .Returns(new List { _sourceProvider.Object }); diff --git a/src/Test/L0/Worker/Build/TrackingConfigL0.cs b/src/Test/L0/Worker/Build/TrackingConfigL0.cs index c017aa2b11..f1eefd89c3 100644 --- a/src/Test/L0/Worker/Build/TrackingConfigL0.cs +++ b/src/Test/L0/Worker/Build/TrackingConfigL0.cs @@ -10,6 +10,7 @@ using Microsoft.VisualStudio.Services.Agent.Worker.Build; using Moq; using Xunit; +using Agent.Sdk; namespace Microsoft.VisualStudio.Services.Agent.Tests.Worker.Build { @@ -44,6 +45,7 @@ public void TrackingConfig_copy_legacy_ctor_should_fill_in_fields_correctly() using (TestHostContext tc = Setup(out Mock mockExecutionContext)) { // Arrange. + mockExecutionContext.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); var legacyConfig = new LegacyTrackingConfig { BuildDirectory = Path.Combine("path", "_work", "123"), @@ -84,6 +86,7 @@ public void TrackingConfig_ctor_should_fill_in_fields_correctly() { using (TestHostContext tc = Setup(out Mock mockExecutionContext)) { + mockExecutionContext.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); // Arrange. var repository = new RepositoryResource() { Type = RepositoryTypes.Git, Url = new Uri(RepositoryUrl) }; @@ -119,6 +122,7 @@ public void TrackingConfig_clone_should_fill_in_fields_correctly() using (TestHostContext tc = Setup(out Mock mockExecutionContext)) { // Arrange. + mockExecutionContext.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); var repository = new RepositoryResource() { Type = RepositoryTypes.Git, Url = new Uri(RepositoryUrl) }; // Act. diff --git a/src/Test/L0/Worker/Build/TrackingManagerL0.cs b/src/Test/L0/Worker/Build/TrackingManagerL0.cs index 1cf3b1e42e..02382a2782 100644 --- a/src/Test/L0/Worker/Build/TrackingManagerL0.cs +++ b/src/Test/L0/Worker/Build/TrackingManagerL0.cs @@ -15,6 +15,7 @@ using System.Text.RegularExpressions; using Xunit; using Agent.Sdk.Knob; +using Agent.Sdk; namespace Microsoft.VisualStudio.Services.Agent.Tests.Worker.Build { @@ -49,6 +50,7 @@ public TestHostContext Setup([CallerMemberName] string name = "") _variables.Set(Constants.Variables.System.DefinitionId, DefinitionId); _variables.Set(Constants.Variables.Build.DefinitionName, DefinitionName); _ec.Setup(x => x.Variables).Returns(_variables); + _ec.Setup(x => x.GetScopedEnvironment()).Returns(new SystemEnvironment()); // Setup the endpoint. _repository = new Pipelines.RepositoryResource() { Url = new Uri(RepositoryUrl) };