Skip to content

Commit

Permalink
Updates to enable live testing in sovereign clouds for multiple services
Browse files Browse the repository at this point in the history
  • Loading branch information
AFengKK authored and v-xuto committed Sep 27, 2021
1 parent 55526df commit ea8b4bf
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 12 deletions.
8 changes: 4 additions & 4 deletions sdk/eventhub/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ stages:
ServiceDirectory: eventhub
BuildTargetingString: azure-eventhub*
DeployArmTemplate: true
SupportedClouds: 'Public,UsGov,China'
MatrixReplace:
- TestSamples=.*/true
MatrixFilters:
Expand All @@ -15,8 +16,7 @@ stages:
AZURE_STORAGE_DATA_LAKE_ENABLED_CONN_STR: $(python-eh-livetest-event-hub-storage-data-lake-enabled-conn-str)
IOTHUB_CONNECTION_STR: $(python-eh-livetest-event-hub-iothub-connection-str)
IOTHUB_DEVICE: $(python-eh-livetest-event-hub-iothub-device)
AZURE_CLIENT_ID: $(python-eh-livetest-event-hub-aad-client-id)
AZURE_TENANT_ID: $(python-eh-livetest-event-hub-aad-tenant-id)
AZURE_CLIENT_SECRET: $(python-eh-livetest-event-hub-aad-secret)
AZURE_SUBSCRIPTION_ID: $(python-eh-livetest-event-hub-subscription-id)
AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID)
AZURE_TENANT_ID: $(EVENTHUB_TENANT_ID)
AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET)
AZURE_COSMOS_CONN_STR: $(python-eventhub-livetest-cosmos-conn-str)
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ def test_copy_model_fail_v21(self, client, formrecognizer_storage_container_sas_
model = poller.result()

# give an incorrect region
target = client.get_copy_authorization(resource_region="eastus", resource_id=formrecognizer_resource_id)
print("formrecognizer_region value is {}".format(formrecognizer_region))
if formrecognizer_region == 'usgovarizona':
resource_regionA = 'usgovvirginia'
else:
resource_regionA = 'usgovarizona'
print("resource_regionA value is {}".format(resource_regionA))
target = client.get_copy_authorization(resource_region=resource_regionA, resource_id=formrecognizer_resource_id)

with pytest.raises(HttpResponseError) as e:
poller = client.begin_copy_model(model.model_id, target=target)
Expand Down
6 changes: 3 additions & 3 deletions sdk/formrecognizer/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"description": "The application client secret used to run tests."
}
},
"formRecognizerEndpointSuffix": {
"cognitiveServicesEndpointSuffix": {
"defaultValue": ".cognitiveservices.azure.com/",
"type": "String"
},
Expand All @@ -56,7 +56,7 @@
},
"blobResourceId": {
"type": "string",
"defaultValue": "[resourceId('2cd617ea-1866-46b1-90e3-fffb087ebf9b', 'TrainingData', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]"
"defaultValue": "[resourceId('TrainingData', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]"
},
"trainingDataSasProperties": {
"type": "object",
Expand Down Expand Up @@ -204,7 +204,7 @@
"authorizationApiVersion": "2018-09-01-preview",
"formRecognizerBaseName": "[concat('formrecognizer', parameters('baseName'))]",
"formRecognizerApiVersion": "2017-04-18",
"azureFormRecognizerUrl": "[concat('https://', variables('formRecognizerBaseName'), parameters('formRecognizerEndpointSuffix'))]",
"azureFormRecognizerUrl": "[concat('https://', variables('formRecognizerBaseName'), parameters('cognitiveServicesEndpointSuffix'))]",
"cognitiveServiceUserRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]"
},
"resources": [
Expand Down
7 changes: 7 additions & 0 deletions sdk/formrecognizer/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ stages:
TestTimeoutInMinutes: 200
MatrixReplace:
- TestSamples=.*/true
SupportedClouds: 'Public,UsGov,China'
Clouds: 'Prod,Canary'
# This is a specific request from the formrecognizer service team
# their claim is that the full matrix ends up stress-testing their service.
Expand All @@ -23,6 +24,12 @@ stages:
MatrixFilters:
- OSVmImage=^(?!macOS).*
- PythonVersion=^(?!pypy3).*
Public:
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
UsGov:
SubscriptionConfiguration: $(sub-config-gov-test-resources)
China:
SubscriptionConfiguration: $(sub-config-cn-test-resources)
EnvVars:
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ stages:
DeployArmTemplate: true
AllocateResourceGroup: true
TestTimeoutInMinutes: 240
SupportedClouds: 'Public,UsGov,China'
${{ if eq(service, 'azure-keyvault-keys') }}:
AdditionalMatrixConfigs:
- Name: keyvault_test_matrix_addons
Expand Down
4 changes: 4 additions & 0 deletions sdk/servicebus/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@
"SERVICE_BUS_SESSION_QUEUE_SAS_KEY":{
"type": "string",
"value": "[listkeys(variables('sessionQueueAuthorizationRuleName'), variables('sbVersion')).primaryKey]"
},
"RESOURCE_REGION": {
"type": "string",
"value": "[parameters('location')]"
}
}
}
15 changes: 11 additions & 4 deletions sdk/servicebus/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ stages:
ServiceDirectory: servicebus
TestTimeoutInMinutes: 300
DeployArmTemplate: true
SupportedClouds: 'Public,UsGov,China'
MatrixReplace:
- TestSamples=.*/true
BuildTargetingString: azure-servicebus*
EnvVars:
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_SUBSCRIPTION_ID: $(SERVICEBUS_SUBSCRIPTION_ID)
AZURE_TENANT_ID: $(SERVICEBUS_TENANT_ID)
AZURE_CLIENT_ID: $(SERVICEBUS_CLIENT_ID)
AZURE_CLIENT_SECRET: $(SERVICEBUS_CLIENT_SECRET)
AZURE_TEST_RUN_LIVE: 'true'
MatrixFilters:
- PythonVersion=^(?!pypy3).*
Expand All @@ -24,3 +25,9 @@ stages:
Canary:
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
Location: 'centraluseuap'
UsGov:
SubscriptionConfiguration: $(sub-config-gov-test-resources)
Location: 'usgovarizona'
China:
SubscriptionConfiguration: $(sub-config-cn-test-resources)
Location: 'chinaeast2'
1 change: 1 addition & 0 deletions sdk/textanalytics/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ stages:
DeployArmTemplate: true
MatrixReplace:
- TestSamples=.*/true
SupportedClouds: 'Public,UsGov,China'
EnvVars:
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
Expand Down

0 comments on commit ea8b4bf

Please sign in to comment.