diff options
author | Deepak Shankargouda <deshank@microsoft.com> | 2016-04-01 20:52:45 -0700 |
---|---|---|
committer | Deepak Shankargouda <deshank@microsoft.com> | 2016-04-01 20:52:45 -0700 |
commit | de540c5ae788fd666d223c40921ea5e05567802d (patch) | |
tree | 97690560edef949d31ad623584156ff33ef533c9 /tests/helixperftasks.targets | |
parent | b6eb7de001be523aa07f56965f5c872e3306486c (diff) | |
download | coreclr-de540c5ae788fd666d223c40921ea5e05567802d.tar.gz coreclr-de540c5ae788fd666d223c40921ea5e05567802d.tar.bz2 coreclr-de540c5ae788fd666d223c40921ea5e05567802d.zip |
Enabling Helix perf test runs for CoreCLR
Enabling Helix perf test runs for CoreCLR
Diffstat (limited to 'tests/helixperftasks.targets')
-rw-r--r-- | tests/helixperftasks.targets | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/helixperftasks.targets b/tests/helixperftasks.targets new file mode 100644 index 0000000000..16fe7dd677 --- /dev/null +++ b/tests/helixperftasks.targets @@ -0,0 +1,87 @@ +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/> + <Import Project="$(ToolsDir)publishtest.targets" /> + <Import Project="$(ToolsDir)CloudTest.targets" /> + <Target Name="UploadPerfAssemblies"> + <Message Text="Searching for Perf tests in $(BinDir)" Importance = "High"/> + <ItemGroup> + <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" /> + </GetPerfTestAssemblies> + + <PropertyGroup> + <TestRuntimeDependenciesJson>$(SourceDir)Common\test_runtime\project.json</TestRuntimeDependenciesJson> + <TestRuntimeProjectLockJson>$(SourceDir)Common\test_runtime\project.lock.json</TestRuntimeProjectLockJson> + </PropertyGroup> + + <!-- Restore the runtime dependencies --> + <Exec Command="$(DnuRestoreCommand) "$(TestRuntimeDependenciesJson)"" + StandardOutputImportance="Low" + CustomErrorRegularExpression="^Unable to resolve .*" + IgnoreExitCode="true" + IgnoreStandardErrorWarningFormat="true" /> + + <!-- For each perf test, generate assembly list, and zip up the workitem --> + <MSBuild Projects="$(MSBuildProjectFile)" Properties="CurrPerfAssembly=%(CoreCLRPerfTest.Identity);TestRuntimeProjectLockJson=$(TestRuntimeProjectLockJson)" Targets="_zipSingleProject"/> + + <!-- After all workitems are packaged, call the CloudBuild Targets from Build Tools which upload these workitems and trigger a test run for these workitems --> + <MSBuild Projects="$(MSBuildProjectFile)" Properties="BinDir=$(BinDir)../" Targets="CloudBuild" /> + + </Target> + + <Target Name="_zipSingleProject"> + <PropertyGroup> + <OutDir>$([System.IO.Path]::GetDirectoryName($(CurrPerfAssembly)))/</OutDir> + <TestArchiveDir>$(BaseOutputPath)\testStagingDir\</TestArchiveDir> + <TestProjectName>$([System.IO.Path]::GetFileNameWithoutExtension($(CurrPerfAssembly)))</TestProjectName> + <ProjectLockJson>$(OutDir)project.lock.json</ProjectLockJson> + </PropertyGroup> + + <ItemGroup> + <TestNugetProjectLockFile Include="$(ProjectLockJson)" Condition="Exists($(ProjectLockJson))"/> + <TestNugetProjectLockFile Include="$(TestRuntimeProjectLockJson)" Condition="Exists($(TestRuntimeProjectLockJson))"/> + </ItemGroup> + + <!-- Generate Assembly list based on the individual project's project.json as well as the common runtime dependencies generated by AddAssFilesToAssemblyList target --> + <PrereleaseResolveNuGetPackageAssets + AllowFallbackOnTargetSelection="true" + IncludeFrameworkReferences="false" + NuGetPackagesDirectory="$(PackagesDir)" + RuntimeIdentifier="$(TestNugetRuntimeId)" + ProjectLanguage="C#" + ProjectLockFile="%(TestNugetProjectLockFile.FullPath)" + TargetMonikers="@(TestTargetFramework)"> + <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RequiredAssemblies" /> + </PrereleaseResolveNuGetPackageAssets> + <ItemGroup> + <AssemblyPaths Include="$([MSBuild]::MakeRelative($(PackagesDir), %(RequiredAssemblies.FullPath)))" /> + </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> + <WriteLinesToFile + File="$(OutDir)/assemblylist.flat.txt" + Lines="@(UniqueAssemblyPaths)" + Overwrite="true" + Encoding="Ascii" /> + + <GenerateAssemblyList + InputListLocation="$(OutDir)assemblylist.flat.txt" + OutputListLocation="$(OutDir)assemblylist.txt" + /> + + <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"/> + </Target> +</Project>
\ No newline at end of file |