<commit_before>parameters:
  rootFolder: '$(Build.SourcesDirectory)'

steps:
  - pwsh: |
        $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1
    displayName: 'Language Specific Certificate Trust'

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=OriginalPath]$env:PATH"
    displayName: 'Store Path Value'

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx"
      Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
    displayName: 'Configure Kestrel Environment Variables'

  - task: UseDotNet@2
    displayName: "Use .NET Core SDK"
    inputs:
      packageType: sdk
      version: 5.0.205

  - pwsh: |
      dotnet tool install azure.sdk.tools.testproxy `
        --tool-path $(Build.BinariesDirectory)/test-proxy `
        --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
        --version 1.0.0-dev.20210811.2
    displayName: "Install test-proxy"

  - pwsh: |
      Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
        -ArgumentList "--storage-location '${{ parameters.rootFolder }}'" `
        -NoNewWindow -PassThru
    displayName: 'Run the testproxy - windows'
    condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'))

  # nohup does NOT continue beyond the current session if you use it within powershell
  - bash: |
      sudo nohup $(Build.BinariesDirectory)/test-proxy/test-proxy &
    displayName: "Run the testproxy - linux/mac"
    condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
    workingDirectory: "${{ parameters.rootFolder }}"

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=PATH]$(OriginalPath)"
    displayName: 'Restore .NET version by resetting path'<commit_msg>resolve mac agent failure (#16128)<commit_after>parameters:
  rootFolder: '$(Build.SourcesDirectory)'

steps:
  - pwsh: |
        $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1
    displayName: 'Language Specific Certificate Trust'

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=OriginalPath]$env:PATH"
    displayName: 'Store Path Value'

  - pwsh: |
      Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx"
      Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
    displayName: 'Configure Kestrel Environment Variables'

  - pwsh: |
      dotnet tool install azure.sdk.tools.testproxy `
        --tool-path $(Build.BinariesDirectory)/test-proxy `
        --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
        --version 1.0.0-dev.20211104.2
    displayName: "Install test-proxy"

  - pwsh: |
      Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
        -ArgumentList "--storage-location '${{ parameters.rootFolder }}'" `
        -NoNewWindow -PassThru
    displayName: 'Run the testproxy - windows'
    condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'))

  # nohup does NOT continue beyond the current session if you use it within powershell
  - bash: |
      nohup $(Build.BinariesDirectory)/test-proxy/test-proxy &
    displayName: "Run the testproxy - linux/mac"
    condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
    workingDirectory: "${{ parameters.rootFolder }}"
{'fraction_non_alphanumeric': 0.13223593964334704, 'fraction_numerical': 0.010699588477366255, 'mean_word_length': 3.7722513089005236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2352870', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1133, 'n_words': 203}