Build-Time Hello World Performance Test (#2681)

Hello world build performance benchmark.
This commit is contained in:
Brian Robbins 2016-04-26 17:52:34 -07:00
parent f420e1478e
commit 705a48940f
6 changed files with 194 additions and 19 deletions

View file

@ -211,7 +211,9 @@ namespace Microsoft.DotNet.Tests.EndToEnd
catch(Exception) {}
Directory.CreateDirectory(RestoredTestProjectDirectory);
WriteNuGetConfig(RestoredTestProjectDirectory);
// Todo: this is a hack until corefx is on nuget.org remove this After RC 2 Release
NuGetConfig.Write(RestoredTestProjectDirectory);
var currentDirectory = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(RestoredTestProjectDirectory);
@ -248,24 +250,6 @@ namespace Microsoft.DotNet.Tests.EndToEnd
return isSupported;
}
// Todo: this is a hack until corefx is on nuget.org remove this After RC 2 Release
private static void WriteNuGetConfig(string directory)
{
var contents = @"<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key=""dotnet-core"" value=""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"" />
<add key=""api.nuget.org"" value=""https://api.nuget.org/v3/index.json"" />
</packageSources>
</configuration>";
var path = Path.Combine(directory, "NuGet.config");
File.WriteAllText(path, contents);
}
private static DateTime GetLastWriteTimeUtcOfDirectoryFiles(string outputDirectory)
{
return Directory.EnumerateFiles(outputDirectory).Max(f => File.GetLastWriteTimeUtc(f));