From fafc2eedaeaf7e2a9fea09f88f7e3a3a1cebad5c Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 26 Jan 2017 12:17:21 -0600 Subject: [PATCH] Work around ZipArchive bug in tests See https://github.com/dotnet/corefx/issues/15516, 'dotnet' executable doesn't get its execute flag set in netcoreapp2.0. --- .../GivenDotnetPublishPublishesProjects.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index b48022c26..9ca7b7404 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -3,6 +3,8 @@ using System; using System.IO; +using System.Diagnostics; +using System.Runtime.InteropServices; using FluentAssertions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.PlatformAbstractions; @@ -70,6 +72,12 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .GetDirectory("bin", configuration, "netcoreapp1.0", rid, "publish", $"{testAppName}{Constants.ExeSuffix}") .FullName; + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + //Workaround for https://github.com/dotnet/corefx/issues/15516 + Process.Start("chmod", $"u+x {outputProgram}").WaitForExit(); + } + new TestCommand(outputProgram) .ExecuteWithCapturedOutput() .Should().Pass()