From f43226c2f1981875fb7943889a680489ade1d3e4 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Wed, 15 Aug 2018 15:06:03 -0700 Subject: [PATCH] Fix test with framework-dependent apphost. This commit fixes the `ItPublishesFrameworkDependentWithRid` test to ensure the apphost is present in the published files. It also runs the application from the apphost to ensure it executes successfully. Fixes #9843. --- build/DependencyVersions.props | 2 +- .../GivenDotnetPublishPublishesProjects.cs | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index b6d4bdc10..87e446562 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -23,7 +23,7 @@ $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) - 2.2.100-preview1-63130-08 + 2.2.100-preview1-63215-01 $(MicrosoftNETSdkPackageVersion) 2.1.1 2.1.400-preview1-20180705-1834985 diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index cf4a29a33..d2c6e0ae7 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -123,6 +123,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var outputDirectory = PublishApp(testAppName, rid, args); outputDirectory.Should().OnlyHaveFiles(new[] { + $"{testAppName}{Constants.ExeSuffix}", $"{testAppName}.dll", $"{testAppName}.pdb", $"{testAppName}.deps.json", @@ -131,10 +132,14 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); - new DotnetCommand() - .ExecuteWithCapturedOutput(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); + var command = new TestCommand(outputProgram); + command.Environment[Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)"] = + new RepoDirectoriesProvider().DotnetRoot; + command.ExecuteWithCapturedOutput() + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World"); } [Theory]