Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #535 from Microsoft/cithomas/aspnetcoretesttempfix
Browse files Browse the repository at this point in the history
Temp. fix for dotnet core functional test failing.
  • Loading branch information
cijothomas authored May 3, 2017
2 parents 62e2bd3 + 737b5f4 commit c39a4a1
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,22 @@ private static void EnsureDotNetCoreInstalled()
{
Trace.TraceInformation(string.Format(CultureInfo.InvariantCulture, "Dotnet.exe process output: {0}", output));

// Look for first dash to get semantic version. (for example: 1.0.0-preview2-003156)
int dashIndex = output.IndexOf('-');
Version version = new Version(dashIndex == -1 ? output : output.Substring(0, dashIndex));

Version minVersion = new Version("1.0.0");
if (version < minVersion)
// We now know dotnet core is installed. Attemping to validate version is flaky as --version sometimes dont redirect all
// messages. Catch the exception and move on for now.
try
{
// Look for first dash to get semantic version. (for example: 1.0.0-preview2-003156)
int dashIndex = output.IndexOf('-');
Version version = new Version(dashIndex == -1 ? output : output.Substring(0, dashIndex));

Version minVersion = new Version("1.0.0");
if (version < minVersion)
{
Assert.Inconclusive($".Net Core version ({output}) must be greater than or equal to {minVersion}.");
}
} catch(Exception ex)
{
Assert.Inconclusive($".Net Core version ({output}) must be greater than or equal to {minVersion}.");
Trace.TraceInformation(string.Format(CultureInfo.InvariantCulture, "DotNetCore version check failed with exception : {0}. Test will still continue.", ex.Message));
}
}
}
Expand Down

0 comments on commit c39a4a1

Please sign in to comment.