trigger: none

jobs:
  - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml
    parameters:
      BuildTargetingString: azure-ai-formrecognizer
      ServiceDirectory: formrecognizer
      TestTimeoutInMinutes: 200
      # This is a specific request from the formrecognizer service team
      # their claim is that the full matrix ends up stress-testing their service.
      # As such, the canary test runs should run on a reduced matrix.
      ${{ if contains(variables['Build.DefinitionName'], 'prod') }}:
        Matrix:
          Linux_Python35:
            OSVmImage: 'ubuntu-18.04'
            PythonVersion: '3.5'
          MacOs_Python37:
            OSVmImage: 'macOS-10.15'
            PythonVersion: '3.7'
          Windows_Python27:
            OSVmImage: 'windows-2019'
            PythonVersion: '2.7'
          Linux_PyPy3:
            OSVmImage: 'ubuntu-18.04'
            PythonVersion: 'pypy3'
          Linux_Python39:
            OSVmImage: 'ubuntu-18.04'
            PythonVersion: '3.9.0'
      ${{ if not(contains(variables['Build.DefinitionName'], 'prod')) }}:
        Matrix:
          Linux_Python35:
            OSVmImage: 'ubuntu-18.04'
            PythonVersion: '3.5'
          Windows_Python27:
            OSVmImage: 'windows-2019'
            PythonVersion: '2.7'
          Linux_Python39:
            OSVmImage: 'ubuntu-18.04'
            PythonVersion: '3.9.0'
      EnvVars:
        AZURE_FORM_RECOGNIZER_PYTHON_CANARY_API_KEY: $(python-formrecognizer-test-canary-api-key)
        AZURE_FORM_RECOGNIZER_PYTHON_API_KEY: $(python-formrecognizer-test-api-key)
        AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
        AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
        AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
        AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
        AZURE_FORM_RECOGNIZER_STORAGE_CONTAINER_SAS_URL: $(python-formrecognizer-test-storage-sas-url)
        AZURE_FORM_RECOGNIZER_MULTIPAGE_STORAGE_CONTAINER_SAS_URL: $(python-formrecognizer-test-storage-multipage-sas-url)
        AZURE_FORM_RECOGNIZER_MULTIPAGE_STORAGE_CONTAINER_SAS_URL_2: $(python-formrecognizer-test-storage-multipage-sas-url2)
        AZURE_FORM_RECOGNIZER_SELECTION_MARK_STORAGE_CONTAINER_SAS_URL: $(python-formrecognizer-test-selection-mark-storage-sas-url)
        AZURE_FORM_RECOGNIZER_TESTING_DATA_CONTAINER_SAS_URL: $(python-formrecognizer-test-storage-testing-data-sas-url)
        AZURE_FORM_RECOGNIZER_AAD_ENDPOINT: $(python-formrecognizer-test-aad-endpoint)
        TEST_MODE: 'RunLiveNoRecord'
        AZURE_SKIP_LIVE_RECORDING: 'True'
        AZURE_TEST_RUN_LIVE: 'true'
