Use built version of redist instead of stage 0 for running tests

This commit is contained in:
Daniel Plaisted 2018-11-12 11:31:10 -08:00
parent e13e5fca99
commit b7e4f06bed
4 changed files with 7 additions and 64 deletions

View file

@ -54,8 +54,12 @@ namespace Microsoft.DotNet.Tests.EndToEnd
.WithWorkingDirectory(projectDirectory);
// Set DOTNET_ROOT as workaround for https://github.com/dotnet/cli/issues/10196
runCommand = runCommand.WithEnvironmentVariable(Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)",
Path.GetDirectoryName(DotnetUnderTest.FullName));
var dotnetRoot = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);
if (!string.IsNullOrEmpty(dotnetRoot))
{
runCommand = runCommand.WithEnvironmentVariable(Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)",
dotnetRoot);
}
runCommand.ExecuteWithCapturedOutput()
.Should().Pass()

View file

@ -25,16 +25,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> BeVisuallyEquivalentToIfNotLocalized(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
if (!DotnetUnderTest.IsLocalized())
{
return BeVisuallyEquivalentTo(assertions, expected, because, becauseArgs);
}
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> ContainVisuallySameFragment(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
Execute.Assertion
@ -44,15 +34,5 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> ContainVisuallySameFragmentIfNotLocalized(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
if (!DotnetUnderTest.IsLocalized())
{
return ContainVisuallySameFragment(assertions, expected, because, becauseArgs);
}
return new AndConstraint<StringAssertions>(assertions);
}
}
}

View file

@ -8,7 +8,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public class DotnetCommand : TestCommand
{
public DotnetCommand()
: this(DotnetUnderTest.FullName)
: this(RepoDirectoriesProvider.DotnetUnderTest)
{
}

View file

@ -1,41 +0,0 @@
// 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 System.Globalization;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public static class DotnetUnderTest
{
static string _pathToDotnetUnderTest;
public static string FullName
{
get
{
if (_pathToDotnetUnderTest == null)
{
_pathToDotnetUnderTest = new Muxer().MuxerPath;
}
return _pathToDotnetUnderTest;
}
}
public static bool IsLocalized()
{
for (var culture = CultureInfo.CurrentUICulture; !culture.Equals(CultureInfo.InvariantCulture); culture = culture.Parent)
{
if (culture.Name == "en")
{
return false;
}
}
return true;
}
}
}