diff --git a/test/EndToEnd/GivenDotNetUsesMSBuild.cs b/test/EndToEnd/GivenDotNetUsesMSBuild.cs index 4cbb5f0f5..1cf20cdb7 100644 --- a/test/EndToEnd/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd/GivenDotNetUsesMSBuild.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using System.IO; using Microsoft.DotNet.Tools.Test.Utilities; using Xunit; @@ -91,6 +92,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd var testAppName = "MSBuildTestAppWithToolInDependencies"; var testInstance = TestAssetsManager .CreateTestInstance(testAppName); + var configuration = Environment.GetEnvironmentVariable("Configuration") ?? "Debug"; var testProjectDirectory = testInstance.TestRoot; @@ -108,7 +110,8 @@ namespace Microsoft.DotNet.Tests.EndToEnd new DotnetCommand() .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("-v dependency-tool-invoker -f netcoreapp1.0 portable") + .ExecuteWithCapturedOutput( + $"-v dependency-tool-invoker -c {configuration} -f netcoreapp1.0 portable") .Should() .Pass() .And diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolverBeingUsedWithMSBuild.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolverBeingUsedWithMSBuild.cs index 8633c0753..e73b8b77f 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolverBeingUsedWithMSBuild.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolverBeingUsedWithMSBuild.cs @@ -19,6 +19,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests { private TestInstance MSBuildTestProjectInstance; private RepoDirectoriesProvider _repoDirectoriesProvider; + private string _configuration; public GivenAProjectDependencyCommandResolverBeingUsedWithMSBuild() { @@ -38,6 +39,8 @@ namespace Microsoft.DotNet.Cli.Utils.Tests .Should() .Pass(); + _configuration = Environment.GetEnvironmentVariable("Configuration") ?? "Debug"; + Environment.SetEnvironmentVariable( Constants.MSBUILD_EXE_PATH, Path.Combine(_repoDirectoriesProvider.Stage2Sdk, "msbuild.exe")); @@ -54,7 +57,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", CommandArguments = null, ProjectDirectory = MSBuildTestProjectInstance.Path, - Configuration = "Debug", + Configuration = _configuration, Framework = FrameworkConstants.CommonFrameworks.NetCoreApp10 }; @@ -79,7 +82,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", CommandArguments = null, ProjectDirectory = MSBuildTestProjectInstance.Path, - Configuration = "Debug", + Configuration = _configuration, Framework = FrameworkConstants.CommonFrameworks.NetCoreApp10 }; @@ -99,7 +102,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "nonexistent-command", CommandArguments = null, ProjectDirectory = MSBuildTestProjectInstance.Path, - Configuration = "Debug", + Configuration = _configuration, Framework = FrameworkConstants.CommonFrameworks.NetCoreApp10 }; @@ -122,7 +125,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", CommandArguments = null, ProjectDirectory = testInstance.Path, - Configuration = "Debug", + Configuration = _configuration, Framework = FrameworkConstants.CommonFrameworks.NetCoreApp10, OutputPath = outputDir };