<commit_before><Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="CreateAzureFileShare" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="SendJsonToDocumentDb" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="SendToEventHub" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="UploadToAzure" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="WriteItemsToJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="WriteTestBuildStatsJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="ZipFileCreateFromDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <!-- set Helix environment vars based on target platform -->
  <PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
    <HelixPythonPath>%HELIX_PYTHONPATH%</HelixPythonPath>
    <HelixScriptRoot>%HELIX_SCRIPT_ROOT%\</HelixScriptRoot>
  </PropertyGroup>
  <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">
    <HelixPythonPath>$HELIX_PYTHONPATH</HelixPythonPath>
    <HelixScriptRoot>$HELIX_SCRIPT_ROOT/</HelixScriptRoot>
  </PropertyGroup>

  <PropertyGroup>
    <ContainerName>$(TestProduct)-$(Branch)-$(BuildMoniker)</ContainerName>
    <ContainerName>$(ContainerName.ToLower())</ContainerName>
    <FuncTestListFilename>FuncTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</FuncTestListFilename>
    <PerfTestListFilename>PerfTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</PerfTestListFilename>
    <ArchivesRoot>$(TestWorkingDir)$(OSPlatformConfig)/archive/</ArchivesRoot>
    <TestArchivesRoot>$(ArchivesRoot)Tests/</TestArchivesRoot>
    <PackagesArchiveFilename>Packages.zip</PackagesArchiveFilename>
    <PackagesArchiveFile>$(ArchivesRoot)$(PackagesArchiveFilename)</PackagesArchiveFile>
    <FuncTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(FuncTestListFilename)</FuncTestListFile>
    <PerfTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(PerfTestListFilename)</PerfTestListFile>
    <BuildStatsJsonFile>$(TestWorkingDir)$(OSPlatformConfig)/BuildStats.json</BuildStatsJsonFile>
    <RunnerScript Condition="'$(RunnerScript)' == ''">$(HelixScriptRoot)xunitrunner.py</RunnerScript>
    <SupplementalPayloadDir Condition="'$(SupplementalPayloadDir)' == ''">$(TestWorkingDir)SupplementalPayload/</SupplementalPayloadDir>
    <SupplementalPayloadFilename>SupplementalPayload.zip</SupplementalPayloadFilename>
    <SupplementalPayloadFile>$(ArchivesRoot)$(SupplementalPayloadFilename)</SupplementalPayloadFile>
    <OverwriteOnUpload Condition="'$(OverwriteOnUpload)' == ''">false</OverwriteOnUpload>
  </PropertyGroup>

  <Import Project="$(MSBuildThisFileDirectory)CloudTest.Perf.targets" Condition="'$(Performance)' == 'true'" />

  <!-- main entrypoint -->
  <Target Name="CloudBuild"
          AfterTargets="Build"
          DependsOnTargets="VerifyInputs;PreCloudBuild;CreateTestListJson;UploadContent" />

  <!-- gather the test archives for upload -->
  <ItemGroup>
    <ForUpload Include="$(TestArchivesRoot)*.zip" />
  </ItemGroup>

  <Target Name="VerifyInputs">
    <!-- verify all required properties have been specified -->
    <Error Condition="'$(Creator)' == ''" Text="Missing required property Creator." />
    <Error Condition="'$(TargetQueue)' == ''" Text="Missing required property TargetQueue." />
    <Error Condition="'$(TestProduct)' == ''" Text="Missing required property TestProduct." />
    <Error Condition="'$(BuildMoniker)' == ''" Text="Missing required property BuildMoniker." />
    <Error Condition="'$(Branch)' == ''" Text="Missing required property Branch." />
    <Error Condition="'$(CloudDropAccountName)' == ''" Text="Missing required property CloudDropAccountName." />
    <Error Condition="'$(CloudResultsAccountName)' == ''" Text="Missing required property CloudResultsAccountName." />
    <Error Condition="'$(CloudDropAccessToken)' == ''" Text="Missing required property CloudDropAccessToken." />
    <Error Condition="'$(CloudResultsAccessToken)' == ''" Text="Missing required property CloudResultsAccessToken." />
    <Error Condition="'$(BuildCompleteConnection)' == ''" Text="Missing required property BuildCompleteConnection." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(BuildIsOfficialConnection)' == ''" Text="Missing required property BuildIsOfficialConnection." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(DocumentDbKey)' == ''" Text="Missing required property DocumentDbKey." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(DocumentDbUri)' == ''" Text="Missing required property DocumentDbUri." />
    <!-- verify the test archives were created -->
    <Error Condition="'@(ForUpload->Count())' == '0'" Text="Didn't find any test archives in '$(TestArchivesRoot)'." />
    <!-- add relative blob path metadata -->
    <ItemGroup>
      <ForUpload>
        <RelativeBlobPath>$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)</RelativeBlobPath>
      </ForUpload>
    </ItemGroup>
  </Target>

  <!-- provided as an extensibility point for targets to run before the real work begins -->
  <Target Name="PreCloudBuild">
    <!-- copy runner scripts so they can be uploaded as supplemental payload -->
    <ItemGroup>
      <RunnerScripts Include="$(ToolsDir)RunnerScripts/**/*.py" />
    </ItemGroup>
    <Copy SourceFiles="@(RunnerScripts)"
          DestinationFiles="@(RunnerScripts->'$(SupplementalPayloadDir)RunnerScripts/%(RecursiveDir)%(Filename)%(Extension)')"
          SkipUnchangedFiles="true" />
    <!-- compress the supplemental payload directory for upload -->
    <ZipFileCreateFromDirectory
        SourceDirectory="$(SupplementalPayloadDir)"
        DestinationArchive="$(SupplementalPayloadFile)"
        OverwriteDestination="true" />
    <ItemGroup>
      <SupplementalPayload Include="$(SupplementalPayloadFile)">
        <RelativeBlobPath>$(SupplementalPayloadFilename)</RelativeBlobPath>
      </SupplementalPayload>
    </ItemGroup>
  </Target>

  <!-- create Azure containers and file shares -->
  <Target Name="CreateAzureStorage">
    <CreateAzureContainer
      AccountKey="$(CloudDropAccessToken)"
      AccountName="$(CloudDropAccountName)"
      ContainerName="$(ContainerName)"
      ReadOnlyTokenDaysValid="30">
        <Output TaskParameter="StorageUri" PropertyName="DropUri" />
        <Output TaskParameter="ReadOnlyToken" PropertyName="DropUriReadOnlyToken" />
    </CreateAzureContainer>
    <!-- now that we have a drop URI create the list of correlation payloads -->
    <ItemGroup>
      <CorrelationPayloadUri Include="$(DropUri)$(Platform)$(ConfigurationGroup)/Packages.zip$(DropUriReadOnlyToken)" />
      <CorrelationPayloadUri Include="@(SupplementalPayload->'$(DropUri)%(RelativeBlobPath)$(DropUriReadOnlyToken)')" />
    </ItemGroup>
    <!-- flatten it into a property as msbuild chokes on @(CorrelationPayloadUri) in FunctionalTest.CorrelationPayloadUris :( -->
    <PropertyGroup>
      <CorrelationPayloadUris>@(CorrelationPayloadUri)</CorrelationPayloadUris>
    </PropertyGroup>
    <CreateAzureContainer
      AccountKey="$(CloudResultsAccessToken)"
      AccountName="$(CloudResultsAccountName)"
      ContainerName="$(ContainerName)"
      ReadOnlyTokenDaysValid="30"
      WriteOnlyTokenDaysValid="1">
        <Output TaskParameter="StorageUri" PropertyName="ResultsUri" />
        <Output TaskParameter="ReadOnlyToken" PropertyName="ResultsReadOnlyToken" />
        <Output TaskParameter="WriteOnlyToken" PropertyName="ResultsWriteOnlyToken" />
    </CreateAzureContainer>
  </Target>

  <Target Name="CreateTestListJson"
          DependsOnTargets="CreateFuncTestListJson;CreatePerfTestListJson" />

  <!-- allow skipping this target if perf testing is enabled -->
  <Target Name="CreateFuncTestListJson"
          DependsOnTargets="CreateAzureStorage"
          Condition="'$(Performance)' != 'true' or '$(FuncTestsDisabled)' != 'true'">
    <!-- create item group of functional tests -->
    <ItemGroup>
      <FunctionalTest Include="$(TestArchivesRoot)*.zip" />
    </ItemGroup>
    <ItemGroup>
      <FunctionalTest>
        <Command>$(HelixPythonPath) $(RunnerScript) --dll %(Filename).dll $(OtherRunnerScriptArgs) -- $(XunitArgs)</Command>
        <CorrelationPayloadUris>[$(CorrelationPayloadUris)]</CorrelationPayloadUris>
        <PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
        <WorkItemId>FunctionalTest.%(Filename)</WorkItemId>
      </FunctionalTest>
    </ItemGroup> 
    <WriteItemsToJson JsonFileName="$(FuncTestListFile)" Items="@(FunctionalTest)" />
    <!-- add test lists to the list of items for upload -->
    <ItemGroup>
      <ForUpload Include="$(FuncTestListFile)">
        <RelativeBlobPath>$(FuncTestListFilename)</RelativeBlobPath>
      </ForUpload>
    </ItemGroup>
    <!-- for completion event -->
    <ItemGroup>
      <TestListFile Include="$(FuncTestListFile)">
        <CorrelationId>$([System.Guid]::NewGuid())</CorrelationId>
        <BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncBuildComplete.json</BuildCompleteJson>
        <OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncOfficialBuild.json</OfficialBuildJson>
      </TestListFile>
    </ItemGroup>
  </Target>

  <Target Name="CreatePerfTestListJson" DependsOnTargets="CreateAzureStorage" Condition="'$(Performance)' == 'true'">
    <PropertyGroup>
      <OtherRunnerScriptArgs>--perf-runner Microsoft.DotNet.xunit.performance.runner.Windows $(OtherRunnerScriptArgs)</OtherRunnerScriptArgs>
    </PropertyGroup>
    <!-- now gather the perf tests -->
    <ItemGroup>
      <TestBinary Include="$(BinDir)$(OSPlatformConfig)/**/*Tests.dll" />
    </ItemGroup>
    <GetPerfTestAssemblies TestBinaries="@(TestBinary)">
      <Output TaskParameter="PerfTestAssemblies" ItemName="PerfTestAssembly" />
    </GetPerfTestAssemblies>
    <!-- don't add any items to the group if no perf tests were found -->
    <ItemGroup Condition="'@(PerfTestAssembly->Count())' != '0'">
      <PerfTest Include="$(TestArchivesRoot)%(PerfTestAssembly.Identity).zip" />
    </ItemGroup>
    <ItemGroup Condition="'@(PerfTestAssembly->Count())' != '0'">
      <PerfTest>
        <Command>$(HelixPythonPath) $(RunnerScript) --dll %(Filename).dll $(OtherRunnerScriptArgs) -- $(XunitArgs)</Command>
        <CorrelationPayloadUris>[$(CorrelationPayloadUris)]</CorrelationPayloadUris>
        <PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
        <WorkItemId>PerfTest.%(Filename)</WorkItemId>
        <TimeoutInSeconds>600</TimeoutInSeconds>
      </PerfTest><commit_msg>Fixes for cloud testing.<commit_after><Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="CreateAzureFileShare" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="SendJsonToDocumentDb" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="SendToEventHub" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="UploadToAzure" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="WriteItemsToJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="WriteTestBuildStatsJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
  <UsingTask TaskName="ZipFileCreateFromDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <!-- set Helix environment vars based on target platform -->
  <PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
    <HelixPythonPath>%HELIX_PYTHONPATH%</HelixPythonPath>
    <HelixScriptRoot>%HELIX_SCRIPT_ROOT%\</HelixScriptRoot>
  </PropertyGroup>
  <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">
    <HelixPythonPath>$HELIX_PYTHONPATH</HelixPythonPath>
    <HelixScriptRoot>$HELIX_SCRIPT_ROOT/</HelixScriptRoot>
  </PropertyGroup>

  <PropertyGroup>
    <ContainerName>$(TestProduct)-$(Branch)-$(BuildMoniker)</ContainerName>
    <ContainerName>$(ContainerName.ToLower())</ContainerName>
    <FuncTestListFilename>FuncTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</FuncTestListFilename>
    <PerfTestListFilename>PerfTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</PerfTestListFilename>
    <ArchivesRoot>$(TestWorkingDir)$(OSPlatformConfig)/archive/</ArchivesRoot>
    <TestArchivesRoot>$(ArchivesRoot)Tests/</TestArchivesRoot>
    <PackagesArchiveFilename>Packages.zip</PackagesArchiveFilename>
    <PackagesArchiveFile>$(ArchivesRoot)$(PackagesArchiveFilename)</PackagesArchiveFile>
    <FuncTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(FuncTestListFilename)</FuncTestListFile>
    <PerfTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(PerfTestListFilename)</PerfTestListFile>
    <BuildStatsJsonFile>$(TestWorkingDir)$(OSPlatformConfig)/BuildStats.json</BuildStatsJsonFile>
    <RunnerScript Condition="'$(RunnerScript)' == ''">$(HelixScriptRoot)xunitrunner.py</RunnerScript>
    <SupplementalPayloadDir Condition="'$(SupplementalPayloadDir)' == ''">$(TestWorkingDir)SupplementalPayload/</SupplementalPayloadDir>
    <SupplementalPayloadFilename>SupplementalPayload.zip</SupplementalPayloadFilename>
    <SupplementalPayloadFile>$(ArchivesRoot)$(SupplementalPayloadFilename)</SupplementalPayloadFile>
    <OverwriteOnUpload Condition="'$(OverwriteOnUpload)' == ''">false</OverwriteOnUpload>
    <TimeoutInSeconds Condition="'$(TimeoutInSeconds)' == ''">600</TimeoutInSeconds>
  </PropertyGroup>

  <Import Project="$(MSBuildThisFileDirectory)CloudTest.Perf.targets" Condition="'$(Performance)' == 'true'" />

  <!-- main entrypoint -->
  <Target Name="CloudBuild"
          AfterTargets="Build"
          DependsOnTargets="VerifyInputs;PreCloudBuild;CreateTestListJson;UploadContent" />

  <Target Name="VerifyInputs">
    <!-- verify all required properties have been specified -->
    <Error Condition="'$(Creator)' == ''" Text="Missing required property Creator." />
    <Error Condition="'$(TargetQueue)' == ''" Text="Missing required property TargetQueue." />
    <Error Condition="'$(TestProduct)' == ''" Text="Missing required property TestProduct." />
    <Error Condition="'$(BuildMoniker)' == ''" Text="Missing required property BuildMoniker." />
    <Error Condition="'$(Branch)' == ''" Text="Missing required property Branch." />
    <Error Condition="'$(CloudDropAccountName)' == ''" Text="Missing required property CloudDropAccountName." />
    <Error Condition="'$(CloudResultsAccountName)' == ''" Text="Missing required property CloudResultsAccountName." />
    <Error Condition="'$(CloudDropAccessToken)' == ''" Text="Missing required property CloudDropAccessToken." />
    <Error Condition="'$(CloudResultsAccessToken)' == ''" Text="Missing required property CloudResultsAccessToken." />
    <Error Condition="'$(BuildCompleteConnection)' == ''" Text="Missing required property BuildCompleteConnection." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(BuildIsOfficialConnection)' == ''" Text="Missing required property BuildIsOfficialConnection." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(DocumentDbKey)' == ''" Text="Missing required property DocumentDbKey." />
    <Error Condition="'$(BuildIsOfficial)' == 'true' and '$(DocumentDbUri)' == ''" Text="Missing required property DocumentDbUri." />
    <!-- gather the test archives for upload -->
    <ItemGroup>
      <ForUpload Include="$(TestArchivesRoot)*.zip" />
    </ItemGroup>
    <!-- verify the test archives were created -->
    <Error Condition="'@(ForUpload->Count())' == '0'" Text="Didn't find any test archives in '$(TestArchivesRoot)'." />
    <!-- add relative blob path metadata -->
    <ItemGroup>
      <ForUpload>
        <RelativeBlobPath>$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)</RelativeBlobPath>
      </ForUpload>
    </ItemGroup>
  </Target>

  <!-- provided as an extensibility point for targets to run before the real work begins -->
  <Target Name="PreCloudBuild">
    <!-- copy runner scripts so they can be uploaded as supplemental payload -->
    <ItemGroup>
      <RunnerScripts Include="$(ToolsDir)RunnerScripts/**/*.py" />
    </ItemGroup>
    <Copy SourceFiles="@(RunnerScripts)"
          DestinationFiles="@(RunnerScripts->'$(SupplementalPayloadDir)RunnerScripts/%(RecursiveDir)%(Filename)%(Extension)')"
          SkipUnchangedFiles="true" />
    <!-- compress the supplemental payload directory for upload -->
    <ZipFileCreateFromDirectory
        SourceDirectory="$(SupplementalPayloadDir)"
        DestinationArchive="$(SupplementalPayloadFile)"
        OverwriteDestination="true" />
    <ItemGroup>
      <SupplementalPayload Include="$(SupplementalPayloadFile)">
        <RelativeBlobPath>$(SupplementalPayloadFilename)</RelativeBlobPath>
      </SupplementalPayload>
    </ItemGroup>
  </Target>

  <!-- create Azure containers and file shares -->
  <Target Name="CreateAzureStorage">
    <CreateAzureContainer
      AccountKey="$(CloudDropAccessToken)"
      AccountName="$(CloudDropAccountName)"
      ContainerName="$(ContainerName)"
      ReadOnlyTokenDaysValid="30">
        <Output TaskParameter="StorageUri" PropertyName="DropUri" />
        <Output TaskParameter="ReadOnlyToken" PropertyName="DropUriReadOnlyToken" />
    </CreateAzureContainer>
    <!-- now that we have a drop URI create the list of correlation payloads -->
    <ItemGroup>
      <CorrelationPayloadUri Include="$(DropUri)$(Platform)$(ConfigurationGroup)/Packages.zip$(DropUriReadOnlyToken)" />
      <CorrelationPayloadUri Include="@(SupplementalPayload->'$(DropUri)%(RelativeBlobPath)$(DropUriReadOnlyToken)')" />
    </ItemGroup>
    <!-- flatten it into a property as msbuild chokes on @(CorrelationPayloadUri) in FunctionalTest.CorrelationPayloadUris :( -->
    <PropertyGroup>
      <CorrelationPayloadUris>@(CorrelationPayloadUri)</CorrelationPayloadUris>
    </PropertyGroup>
    <CreateAzureContainer
      AccountKey="$(CloudResultsAccessToken)"
      AccountName="$(CloudResultsAccountName)"
      ContainerName="$(ContainerName)"
      ReadOnlyTokenDaysValid="30"
      WriteOnlyTokenDaysValid="1">
        <Output TaskParameter="StorageUri" PropertyName="ResultsUri" />
        <Output TaskParameter="ReadOnlyToken" PropertyName="ResultsReadOnlyToken" />
        <Output TaskParameter="WriteOnlyToken" PropertyName="ResultsWriteOnlyToken" />
    </CreateAzureContainer>
  </Target>

  <Target Name="CreateTestListJson"
          DependsOnTargets="CreateFuncTestListJson;CreatePerfTestListJson" />

  <!-- allow skipping this target if perf testing is enabled -->
  <Target Name="CreateFuncTestListJson"
          DependsOnTargets="CreateAzureStorage"
          Condition="'$(Performance)' != 'true' or '$(FuncTestsDisabled)' != 'true'">
    <!-- create item group of functional tests -->
    <ItemGroup>
      <FunctionalTest Include="$(TestArchivesRoot)*.zip" />
    </ItemGroup>
    <ItemGroup>
      <FunctionalTest>
        <Command>$(HelixPythonPath) $(RunnerScript) --dll %(Filename).dll $(OtherRunnerScriptArgs) -- $(XunitArgs)</Command>
        <CorrelationPayloadUris>[$(CorrelationPayloadUris)]</CorrelationPayloadUris>
        <PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
        <WorkItemId>FunctionalTest.%(Filename)</WorkItemId>
        <TimeoutInSeconds>$(TimeoutInSeconds)</TimeoutInSeconds>
      </FunctionalTest>
    </ItemGroup> 
    <WriteItemsToJson JsonFileName="$(FuncTestListFile)" Items="@(FunctionalTest)" />
    <!-- add test lists to the list of items for upload -->
    <ItemGroup>
      <ForUpload Include="$(FuncTestListFile)">
        <RelativeBlobPath>$(FuncTestListFilename)</RelativeBlobPath>
      </ForUpload>
    </ItemGroup>
    <!-- for completion event -->
    <ItemGroup>
      <TestListFile Include="$(FuncTestListFile)">
        <CorrelationId>$([System.Guid]::NewGuid())</CorrelationId>
        <BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncBuildComplete.json</BuildCompleteJson>
        <OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncOfficialBuild.json</OfficialBuildJson>
      </TestListFile>
    </ItemGroup>
  </Target>

  <Target Name="CreatePerfTestListJson" DependsOnTargets="CreateAzureStorage" Condition="'$(Performance)' == 'true'">
    <PropertyGroup>
      <OtherRunnerScriptArgs>--perf-runner Microsoft.DotNet.xunit.performance.runner.Windows $(OtherRunnerScriptArgs)</OtherRunnerScriptArgs>
    </PropertyGroup>
    <!-- now gather the perf tests -->
    <ItemGroup>
      <TestBinary Include="$(BinDir)$(OSPlatformConfig)/**/*Tests.dll" />
    </ItemGroup>
    <GetPerfTestAssemblies TestBinaries="@(TestBinary)">
      <Output TaskParameter="PerfTestAssemblies" ItemName="PerfTestAssembly" />
    </GetPerfTestAssemblies>
    <!-- don't add any items to the group if no perf tests were found -->
    <ItemGroup Condition="'@(PerfTestAssembly->Count())' != '0'">
      <PerfTest Include="$(TestArchivesRoot)%(PerfTestAssembly.Identity).zip" />
    </ItemGroup>
    <ItemGroup Condition="'@(PerfTestAssembly->Count())' != '0'">
      <PerfTest>
        <Command>$(HelixPythonPath) $(RunnerScript) --dll %(Filename).dll $(OtherRunnerScriptArgs) -- $(XunitArgs)</Command>
        <CorrelationPayloadUris>[$(CorrelationPayloadUris)]</CorrelationPayloadUris>
        <PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
        <WorkItemId>PerfTest.%(Filename)</WorkItemId>
        <TimeoutInSeconds>$(TimeoutInSeconds)</TimeoutInSeconds>
      </PerfTest>
{'fraction_non_alphanumeric': 0.1521162852346028, 'fraction_numerical': 0.003004329769373509, 'mean_word_length': 5.421276595744681, 'pattern_counts': {'":': 0, '<': 397, '<?xml version=': 0, '>': 407, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1117744', 'n_tokens_mistral': 6471, 'n_tokens_neox': 5935, 'n_words': 954}