Fixing perf runs on helix (#5102)
authorDeepak Shankargouda <deshank@microsoft.com>
Wed, 8 Jun 2016 06:28:13 +0000 (23:28 -0700)
committerDeepak Shankargouda <deshank@microsoft.com>
Wed, 8 Jun 2016 06:28:13 +0000 (23:28 -0700)
* Fixing issue with perf targets restoring test runtime

* Fixing perf runs on helix

tests/dir.props
tests/helix.targets
tests/helixperftasks.targets
tests/src/GC/Performance/README.md
tests/src/JIT/config/benchmark+roslyn/project.json
tests/src/JIT/config/benchmark+serialize/project.json
tests/src/JIT/config/benchmark/project.json
tests/src/performance/perflab/project.json

index ce9063c..870d4e3 100644 (file)
@@ -56,7 +56,7 @@
       <ExpectedVersion>1.0.2-prerelease-00101</ExpectedVersion>
     </ValidationPattern>
     <ValidationPattern Include="^(?i)Microsoft\.DotNet\.xunit\.performance.%2A$">
-      <ExpectedVersion>1.0.0-alpha-build0029</ExpectedVersion>
+      <ExpectedVersion>1.0.0-alpha-build0035</ExpectedVersion>
     </ValidationPattern>
   </ItemGroup>
 
index 36b1431..16acf01 100644 (file)
@@ -12,7 +12,7 @@
     <CoreRootFiles Include="$(CORE_ROOT)\ilasm.exe" /> 
 
     <!-- TODO these files should get copied to core_root but does not as they are xunit files. Using temporary workaround for now -->
-    <CoreRootFiles Include="$(PackagesDir)Microsoft.DotNet.xunit.performance\1.0.0-alpha-build0029\lib\dotnet\xunit.performance.core.dll" />
+    <CoreRootFiles Include="$(PackagesDir)Microsoft.DotNet.xunit.performance\1.0.0-alpha-build0035\lib\dotnet\xunit.performance.core.dll" />
     <CoreRootFiles Include="$(PackagesDir)xunit.extensibility.core\2.1.0\lib\dotnet\xunit.core.dll" />
   </ItemGroup>
 
index 73046cf..52fb7f7 100644 (file)
@@ -1,4 +1,43 @@
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+    <UsingTask TaskName="RemoveDuplicateAssemblies" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
+      <ParameterGroup>
+        <DuplicateAssemblies ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
+        <AssemblyPaths ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
+        <UniqueAssemblyPaths ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
+      </ParameterGroup>
+      <Task>
+        <Using Namespace="System"/>
+        <Using Namespace="System.IO"/>
+        <Using Namespace="System.Collections.Generic"/>
+        <Code Type="Fragment" Language="cs">
+          <![CDATA[
+                  var uniqueAssemblyPathsList = new List<Microsoft.Build.Framework.ITaskItem>();
+                  var dupeSet = new HashSet<string>();
+                  foreach(var dupe in DuplicateAssemblies)
+                  {
+                    dupeSet.Add(dupe.GetMetadata("Identity"));
+                  }
+                  foreach(var assemPath in AssemblyPaths)
+                  {
+                    if((dupeSet.Contains(assemPath.GetMetadata("FileName")+assemPath.GetMetadata("Extension")) &&
+                        !(assemPath.GetMetadata("Identity").StartsWith("runtime"))))
+                    {
+                      Log.LogMessage("Duplicate assembly filtered: {0}", assemPath.GetMetadata("Identity"));
+                    }
+                    else
+                    {
+                      uniqueAssemblyPathsList.Add(assemPath);
+                    }
+
+                  }
+                  uniqueAssemblyPaths = uniqueAssemblyPathsList.ToArray();
+          ]]>
+        </Code>
+      </Task>
+    </UsingTask>
+
+
   <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
   <Import Project="$(ToolsDir)publishtest.targets" />
   <Import Project="$(ToolsDir)CloudTest.targets" />
@@ -8,7 +47,6 @@
       <TestBinary Include="$(BinDir)**/*.dll" />
       <TestBinary Include="$(BinDir)**/*.exe" />
     </ItemGroup>
-
     <!-- Get full paths to each of the perf test directories -->
     <GetPerfTestAssemblies TestBinaries="@(TestBinary)" GetFullPaths="true">
       <Output TaskParameter="PerfTestAssemblies" ItemName="CoreCLRPerfTest" />
 
   </Target>
 
+  <Target Name="RunTestsForProject">
+    <Message Text="This is a dummy target to appease DependsOnTargets for ArchiveTestBuild in publishtest.targets" Importance="Low" />
+  </Target>
+
+  <!-- CoreCLR builds do not generate dependency lists yet, we need to archive the whole packages dir so that tests can find dependencies -->
+  <!-- compress the required files from the packages dir in preparation for uploading -->
+  <Target Name="CompressPackagesDir">
+    <ItemGroup>
+      <ExcludeFromArchive Include="nupkg$" />
+      <ExcludeFromArchive Include="Microsoft.DotNet.BuildTools" />
+      <ExcludeFromArchive Include="TestData" />
+    </ItemGroup>
+    <ZipFileCreateFromDirectory
+        SourceDirectory="$(PackagesDir)"
+        DestinationArchive="$(PackagesArchiveFile)"
+        ExcludePatterns="@(ExcludeFromArchive)"
+        OverwriteDestination="true" />
+    <ItemGroup>
+      <ForUpload Include="$(PackagesArchiveFile)">
+        <RelativeBlobPath>$(Platform)$(ConfigurationGroup)/$(PackagesArchiveFilename)</RelativeBlobPath>
+      </ForUpload>
+    </ItemGroup>
+  </Target>
+
   <Target Name="_zipSingleProject">
     <PropertyGroup>
       <OutDir>$([System.IO.Path]::GetDirectoryName($(CurrPerfAssembly)))/</OutDir>
                                TargetMonikers="@(TestTargetFramework)">
       <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RequiredAssemblies" />
     </PrereleaseResolveNuGetPackageAssets>
+
+
     <ItemGroup>
       <AssemblyPaths Include="$([MSBuild]::MakeRelative($(PackagesDir), %(RequiredAssemblies.FullPath)))" />
+      <AssemblyFiles Include="@(RequiredAssemblies->'%(FileName)%(Extension)')"></AssemblyFiles>
+      <DupeAssemblies Include="%(AssemblyFiles.Identity)" Condition="'@(AssemblyFiles->Count())' &gt; 1"> </DupeAssemblies>
     </ItemGroup>
-    <RemoveDuplicatesWithLastOneWinsPolicy Inputs="@(AssemblyPaths)">
-      <Output TaskParameter="Filtered" ItemName="UniqueAssemblyPaths" />
-    </RemoveDuplicatesWithLastOneWinsPolicy>
-    <PropertyGroup>
-      <_TestCopyLocalByFileNameWithoutDuplicates></_TestCopyLocalByFileNameWithoutDuplicates>
-    </PropertyGroup>
-    <ItemGroup>
-      <UniqueAssemblyPaths Include="$([System.String]::Copy('%(_TestCopyLocalByFileNameWithoutDuplicates.SourcePath)').Replace('$(PackagesDir)',''))" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.NugetPackageId)' != ''" />
-    </ItemGroup>
+    <!-- There are duplicate dependency assemblies calculated for some projects that we need to fix, this is check/fix to weed out duplicates -->
+    <RemoveDuplicateAssemblies AssemblyPaths="@(AssemblyPaths)" DuplicateAssemblies="@(DupeAssemblies)">
+      <Output TaskParameter="UniqueAssemblyPaths" ItemName="UniqueAssemblyPaths" />
+    </RemoveDuplicateAssemblies>
+
     <WriteLinesToFile
       File="$(OutDir)/assemblylist.flat.txt"
       Lines="@(UniqueAssemblyPaths)"
      />
 
     <Message Text="Archiving Perf test assemblies for project: $(OutDir)" Importance="High" />
-    <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName);DisableCopyTestToTestDirectory=true" Targets="ArchiveTestBuild"/>
+    <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName)" Targets="ArchiveTestBuild"/>
   </Target>
 </Project>
\ No newline at end of file
index 239b5df..c38e9c7 100644 (file)
@@ -1,6 +1,6 @@
 # CLR Garbage Collector Performance Tests
 This folder houses both the test framework and test artifacts for performance tests
-targeting the garbage collector. These tests are run using the 
+targeting the garbage collector. These tests are run using the
 [xunit-performance](https://github.com/Microsoft/xunit-performance) performance testing
 framework and can be used with the standard tools provided by that repository.
 
@@ -40,10 +40,10 @@ mkdir sandbox
 pushd sandbox
 
 REM Get the xunit-performance console runner
-xcopy /sy C:\<path_to_your_coreclr>\coreclr\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0029\tools\* .
+xcopy /sy C:\<path_to_your_coreclr>\coreclr\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0035\tools\* .
 
 REM Get the xunit-performance analysis engine
-xcopy /sy C:\<path_to_your_coreclr>\coreclr\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0029\tools\* .
+xcopy /sy C:\<path_to_your_coreclr>\coreclr\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0035\tools\* .
 
 REM Get the xunit console runner
 xcopy /sy C:\<path_to_your_coreclr>\coreclr\packages\xunit.runner.console\2.1.0\tools\* .
index 2c9a438..6478b3a 100644 (file)
@@ -1,9 +1,9 @@
 {
   "dependencies": {
     "Microsoft.CodeAnalysis.Compilers": "1.1.1",
-    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0029",
+    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0035",
     "Microsoft.NETCore.Platforms": "1.0.1-rc3-24117-00",
     "System.Console": "4.0.0-rc3-24117-00",
     "System.Dynamic.Runtime": "4.0.11-rc3-24117-00",
index c2d6616..5802076 100644 (file)
@@ -1,8 +1,8 @@
 {
   "dependencies": {
-    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0029",
+    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0035",
     "Microsoft.NETCore.Platforms": "1.0.1-rc3-24117-00",
     "Newtonsoft.Json": "7.0.1",
     "System.Console": "4.0.0-rc3-24117-00",
index a5a386e..c2eefa0 100644 (file)
@@ -1,8 +1,8 @@
 {
   "dependencies": {
-    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0029",
+    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0035",
     "Microsoft.NETCore.Platforms": "1.0.1-rc3-24117-00",
     "System.Collections.NonGeneric": "4.0.1-rc3-24117-00",
     "System.Console": "4.0.0-rc3-24117-00",
index 0f62d1c..0c14b5f 100644 (file)
@@ -1,8 +1,8 @@
 {
   "dependencies": {
-    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0029",
-    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0029",
+    "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0035",
+    "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0035",
     "Microsoft.NETCore.Platforms": "1.0.1-rc3-24117-00",
     "System.Console": "4.0.0-rc3-24117-00",
     "System.IO.FileSystem": "4.0.1-rc3-24117-00",