Skip to content

Commit

Permalink
[formrecognizer] set up live canary/prod pipelines (#11995)
Browse files Browse the repository at this point in the history
* set up live canary/prod pipelines for form recognizer

* delete test_prod

* remove region

* hardcode buildtargetingstring
  • Loading branch information
kristapratico authored Jun 12, 2020
1 parent bc67d21 commit 6927458
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6927458

Please sign in to comment.