From df8b95d24b99eaa852539f9d0c420365f75bde2f Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 11 Jun 2020 16:01:28 -0700 Subject: [PATCH 1/4] set up live canary/prod pipelines for form recognizer --- .../azure-ai-formrecognizer/tests/testcase.py | 10 ++++--- sdk/formrecognizer/tests.yml | 1 + sdk/formrecognizer/tests_prod.yml | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 sdk/formrecognizer/tests_prod.yml diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py index 8f03f255fdb1..c67bb0592dcf 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py @@ -25,6 +25,8 @@ ) from azure_devtools.scenario_tests.utilities import is_text_payload +REGION = os.getenv('REGION', 'centraluseuap') + class AccessTokenReplacer(RecordingProcessor): """Replace the access token in a request/response body.""" @@ -459,13 +461,13 @@ def create_resource(self, name, **kwargs): resource_id = "/subscriptions/" + subscription_id + "/resourceGroups/" + resource_group.name + \ "/providers/Microsoft.CognitiveServices/accounts/" + form_recognizer_name - resource_location = "centraluseuap" + resource_location = REGION self.test_class_instance.scrubber.register_name_pair( resource_id, "resource_id" ) else: - resource_location = "centraluseuap" + resource_location = REGION resource_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.CognitiveServices/accounts/frname" return { @@ -529,12 +531,12 @@ def create_form_client_and_container_sas_url(self, **kwargs): @pytest.fixture(scope="session") def form_recognizer_account(): test_case = AzureTestCase("__init__") - rg_preparer = ResourceGroupPreparer(random_name_enabled=True, name_prefix='pycog', location="centraluseuap") + rg_preparer = ResourceGroupPreparer(random_name_enabled=True, name_prefix='pycog', location=REGION) form_recognizer_preparer = CognitiveServicesAccountPreparer( random_name_enabled=True, kind="formrecognizer", name_prefix='pycog', - location="centraluseuap" + location=REGION ) try: diff --git a/sdk/formrecognizer/tests.yml b/sdk/formrecognizer/tests.yml index 28c346e0521a..cdde5e0df56d 100644 --- a/sdk/formrecognizer/tests.yml +++ b/sdk/formrecognizer/tests.yml @@ -21,6 +21,7 @@ jobs: 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_AAD_ENDPOINT: $(python-formrecognizer-test-aad-endpoint) + REGION: 'centraluseuap' TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' diff --git a/sdk/formrecognizer/tests_prod.yml b/sdk/formrecognizer/tests_prod.yml new file mode 100644 index 000000000000..9d7cbcada643 --- /dev/null +++ b/sdk/formrecognizer/tests_prod.yml @@ -0,0 +1,27 @@ +trigger: none + +resources: + repositories: + - repository: azure-sdk-tools + type: github + name: Azure/azure-sdk-tools + endpoint: azure + +jobs: + - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + parameters: + BuildTargetingString: $(BuildTargetingString) + ServiceDirectory: formrecognizer + EnvVars: + 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_AAD_ENDPOINT: $(python-formrecognizer-test-aad-endpoint) + REGION: 'westcentralus' + TEST_MODE: 'RunLiveNoRecord' + AZURE_SKIP_LIVE_RECORDING: 'True' + AZURE_TEST_RUN_LIVE: 'true' From 29633314799f5cba37590309c846f84e32c6788b Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 12 Jun 2020 15:08:47 -0700 Subject: [PATCH 2/4] delete test_prod --- sdk/formrecognizer/tests_prod.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 sdk/formrecognizer/tests_prod.yml diff --git a/sdk/formrecognizer/tests_prod.yml b/sdk/formrecognizer/tests_prod.yml deleted file mode 100644 index 9d7cbcada643..000000000000 --- a/sdk/formrecognizer/tests_prod.yml +++ /dev/null @@ -1,27 +0,0 @@ -trigger: none - -resources: - repositories: - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - -jobs: - - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml - parameters: - BuildTargetingString: $(BuildTargetingString) - ServiceDirectory: formrecognizer - EnvVars: - 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_AAD_ENDPOINT: $(python-formrecognizer-test-aad-endpoint) - REGION: 'westcentralus' - TEST_MODE: 'RunLiveNoRecord' - AZURE_SKIP_LIVE_RECORDING: 'True' - AZURE_TEST_RUN_LIVE: 'true' From 8cb5b712b5eecfafacc3516e0c96bd1920a4bd8d Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 12 Jun 2020 15:16:25 -0700 Subject: [PATCH 3/4] remove region --- sdk/formrecognizer/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/formrecognizer/tests.yml b/sdk/formrecognizer/tests.yml index cdde5e0df56d..28c346e0521a 100644 --- a/sdk/formrecognizer/tests.yml +++ b/sdk/formrecognizer/tests.yml @@ -21,7 +21,6 @@ jobs: 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_AAD_ENDPOINT: $(python-formrecognizer-test-aad-endpoint) - REGION: 'centraluseuap' TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' From f86683b884b8ededc0fc4a8acf95c92e77905455 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 12 Jun 2020 15:45:36 -0700 Subject: [PATCH 4/4] hardcode buildtargetingstring --- sdk/formrecognizer/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/tests.yml b/sdk/formrecognizer/tests.yml index 28c346e0521a..469c88f32d93 100644 --- a/sdk/formrecognizer/tests.yml +++ b/sdk/formrecognizer/tests.yml @@ -10,7 +10,7 @@ resources: jobs: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml parameters: - BuildTargetingString: $(BuildTargetingString) + BuildTargetingString: azure-ai-formrecognizer ServiceDirectory: formrecognizer EnvVars: AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)