<commit_before>parameters:
  - name: configuration
    type: string
    default: 'Debug'
  - name: oop64bit
    # This is actually a boolean but must be defined as string.
    # Parameters are evaluated at compile time, but all variables are strings at compile time.
    # So in order to pass a parameter that comes from a variable these must be typed as string.
    type: string
    default: true
  - name: oopCoreClr
    type: string
    default: false
  - name: lspEditor
    type: string
    default: false
  - name: skipCheckout
    type: boolean
    default: false

steps:
  # Pipelines like the DartLab integration pipeline skip checkout because it is performed elsewhere.
  - ${{ if eq(parameters.skipCheckout, false) }}:
    - template: checkout-windows-task.yml

  - task: PowerShell@2
    displayName: Build and Test
    inputs:
      filePath: eng/build.ps1
      arguments: -ci -restore -build -pack -sign -publish -binaryLog -configuration ${{ parameters.configuration }} -prepareMachine -testVsi -oop64bit:$${{ parameters.oop64bit }} -oopCoreClr:$${{ parameters.oopCoreClr }} -collectDumps -lspEditor:$${{ parameters.lspEditor }}

  - task: PublishTestResults@2
    displayName: Publish xUnit Test Results
    inputs:
      testRunner: XUnit
      testResultsFiles: $(Build.SourcesDirectory)\artifacts\TestResults\${{ parameters.configuration }}\*.xml
      mergeTestResults: true
      testRunTitle: '$(System.JobAttempt)-Integration ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }}'
    condition: always()

  - task: PublishBuildArtifacts@1
    displayName: Publish Logs
    inputs:
      PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\${{ parameters.configuration }}'
      ArtifactName: '$(System.JobAttempt)-Logs ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }} LspEditor_${{ parameters.lspEditor }} $(Build.BuildNumber)'
      publishLocation: Container
    continueOnError: true
    condition: not(succeeded())<commit_msg>Keep publishing logs for old integration tests<commit_after>parameters:
  - name: configuration
    type: string
    default: 'Debug'
  - name: oop64bit
    # This is actually a boolean but must be defined as string.
    # Parameters are evaluated at compile time, but all variables are strings at compile time.
    # So in order to pass a parameter that comes from a variable these must be typed as string.
    type: string
    default: true
  - name: oopCoreClr
    type: string
    default: false
  - name: lspEditor
    type: string
    default: false
  - name: skipCheckout
    type: boolean
    default: false

steps:
  # Pipelines like the DartLab integration pipeline skip checkout because it is performed elsewhere.
  - ${{ if eq(parameters.skipCheckout, false) }}:
    - template: checkout-windows-task.yml

  - task: PowerShell@2
    displayName: Build and Test
    inputs:
      filePath: eng/build.ps1
      arguments: -ci -restore -build -pack -sign -publish -binaryLog -configuration ${{ parameters.configuration }} -prepareMachine -testVsi -oop64bit:$${{ parameters.oop64bit }} -oopCoreClr:$${{ parameters.oopCoreClr }} -collectDumps -lspEditor:$${{ parameters.lspEditor }}

  - task: PublishTestResults@2
    displayName: Publish xUnit Test Results
    inputs:
      testRunner: XUnit
      testResultsFiles: $(Build.SourcesDirectory)\artifacts\TestResults\${{ parameters.configuration }}\*.xml
      mergeTestResults: true
      testRunTitle: '$(System.JobAttempt)-Integration ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }}'
    condition: always()

  - task: PublishBuildArtifacts@1
    displayName: Publish Logs
    inputs:
      PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\${{ parameters.configuration }}'
      ArtifactName: '$(System.JobAttempt)-Logs ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }} LspEditor_${{ parameters.lspEditor }} $(Build.BuildNumber)'
      publishLocation: Container
    continueOnError: true
    condition: not(succeeded())

  - task: PublishBuildArtifacts@1
    displayName: Publish Screenshots and Test Attachments (Old Tests)
    inputs:
      PathtoPublish: '$(Build.SourcesDirectory)\artifacts\bin\Microsoft.VisualStudio.LanguageServices.IntegrationTests\${{ parameters.configuration }}\net472\TestResults'
      ArtifactName: '$(System.JobAttempt)-Screenshots ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }} LspEditor_${{ parameters.lspEditor }} $(Build.BuildNumber)'
      publishLocation: Container
    continueOnError: true
    condition: not(succeeded())
{'fraction_non_alphanumeric': 0.10833508293092589, 'fraction_numerical': 0.009237875288683603, 'mean_word_length': 3.9316770186335406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3816813', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1333, 'n_words': 378}