Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions scripts/devops_tasks/test_run_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,39 @@
"consume_cloud_events_from_eventhub.py",
"consume_cloud_events_from_service_bus_queue.py",
"consume_cloud_events_from_storage_queue.py"],
"azure-eventhub": [
"authenticate_with_sas_token.py",
"connection_to_custom_endpoint_address.py",
"proxy.py",
"receive_batch_with_checkpoint.py",
"recv.py",
"recv_track_last_enqueued_event_prop.py",
"recv_with_checkpoint_by_event_count.py",
"recv_with_checkpoint_by_time_interval.py",
"recv_with_checkpoint_store.py",
"recv_with_custom_starting_position.py",
"sample_code_eventhub.py",
"authenticate_with_sas_token_async.py",
"connection_to_custom_endpoint_address_async.py",
"iot_hub_connection_string_receive_async.py",
"proxy_async.py",
"receive_batch_with_checkpoint_async.py",
"recv_async.py",
"recv_track_last_enqueued_event_prop_async.py",
"recv_with_checkpoint_by_event_count_async.py",
"recv_with_checkpoint_by_time_interval_async.py",
"recv_with_checkpoint_store_async.py",
"recv_with_custom_starting_position_async.py",
"sample_code_eventhub_async.py"
Comment thread
swathipil marked this conversation as resolved.
],
"azure-eventhub-checkpointstoreblob": [
"receive_events_using_checkpoint_store.py",
"receive_events_using_checkpoint_store_storage_api_version.py"
],
"azure-eventhub-checkpointstoreblob-aio": [
"receive_events_using_checkpoint_store_async.py",
"receive_events_using_checkpoint_store_storage_api_version_async.py"
],
"azure-servicebus": [
"failure_and_recovery.py",
"mgmt_queue.py",
Expand Down
202 changes: 202 additions & 0 deletions sdk/eventhub/test-resources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name."
}
},
"subscriptionId": {
"type": "string",
"defaultValue": "[subscription().subscriptionId]",
"metadata": {
"description": "The subscription ID to which the application and resources belong."
}
},
"tenantId": {
"type": "string",
"defaultValue": "[subscription().tenantId]",
"metadata": {
"description": "The tenant ID to which the application and resources belong."
}
},
"testApplicationOid": {
"type": "string",
"metadata": {
"description": "The client OID to grant access to test resources."
}
},
"testApplicationId": {
"type": "string",
"metadata": {
"description": "The application client ID used to run tests."
}
},
"testApplicationSecret": {
"type": "string",
"metadata": {
"description": "The application client secret used to run tests."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location of the resources. By default, this is the same as the resource group."
}
},
"storageEndpointSuffix": {
"type": "string",
"defaultValue": "core.windows.net",
"metadata": {
"description": "The url suffix to use when creating storage connection strings."
}
},
"perTestExecutionLimitMinutes": {
"type": "string",
"defaultValue": "10",
"metadata": {
"description": "The maximum duration, in minutes, that a single test is permitted to run before it is considered at-risk for being hung."
}
}
},
"variables": {
"ehVersion": "2017-04-01",
"contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"eventHubsDataOwnerRoleId": "f526a384-b230-433a-b45c-95f59c4a2dec",
Comment thread
yunhaoling marked this conversation as resolved.
"eventHubsNamespace": "[concat('eh-', parameters('baseName'))]",
"eventHubName": "[concat('eh-', parameters('baseName'), '-hub')]",
"eventHubAuthRuleName": "[concat('eh-', parameters('baseName'), '-hub-auth-rule')]",
"storageAccount": "[concat('blb', parameters('baseName'))]",
"containerName": "your-blob-container-name",
"defaultSASKeyName": "RootManageSharedAccessKey",
"eventHubsAuthRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', variables('eventHubsNamespace'), variables('defaultSASKeyName'))]",
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount'))]",
},
"resources": [
{
"apiVersion": "[variables('ehVersion')]",
"name": "[variables('eventHubsNamespace')]",
"type": "Microsoft.EventHub/Namespaces",
"location": "[parameters('location')]",
"sku": {
"name": "Standard",
"tier": "Standard"
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "[variables('ehVersion')]",
"name": "[concat(variables('eventHubsNamespace'), '/', variables('eventHubName'))]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubsNamespace'))]"
],
"properties": {
"messageRetentionInDays": 7,
"partitionCount": 1
},
"resources": [
{
"apiVersion": "[variables('ehVersion')]",
"name": "[variables('eventHubAuthRuleName')]",
"type": "authorizationRules",
"dependsOn": [
"[variables('eventHubName')]"
],
"properties": {
"Rights": ["Manage", "Send", "Listen"]
}
}
]
}
],
"properties": {}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccount')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "StorageV2",
"properties": {
"accessTier": "Hot"
},
"resources": [
{
"type": "blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat('default/', variables('containerName'))]",
"dependsOn": [
"[variables('storageAccount')]"
]
}
]
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2019-04-01-preview",
"name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('eventHubsDataOwnerRoleId'), parameters('testApplicationOid'))]",
"properties": {
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('eventHubsDataOwnerRoleId'))]",
"principalId": "[parameters('testApplicationOid')]",
"scope": "[resourceGroup().id]"
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2019-04-01-preview",
"name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('contributorRoleId'), parameters('testApplicationOid'))]",
"properties": {
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]",
"principalId": "[parameters('testApplicationOid')]",
"scope": "[resourceGroup().id]"
}
}
],
"outputs": {
"EVENT_HUB_NAMESPACE": {
"type": "string",
"value": "[variables('eventHubsNamespace')]"
},
"EVENT_HUB_HOSTNAME": {
"type": "string",
"value": "[concat(variables('eventHubsNamespace'), '.servicebus.windows.net')]"
},
"EVENT_HUB_CONN_STR": {
"type": "string",
"value": "[listkeys(variables('eventHubAuthRuleName'), variables('ehVersion')).primaryConnectionString]"
},
"EVENT_HUB_NAME": {
"type": "string",
"value": "[variables('eventHubName')]"
},
"EVENT_HUB_SAS_POLICY":{
"type": "string",
"value": "[variables('eventHubAuthRuleName')]"
},
"EVENT_HUB_SAS_KEY":{
"type": "string",
"value": "[listkeys(variables('eventHubAuthRuleName'), variables('ehVersion')).primaryKey]"
},
"AZURE_STORAGE_CONN_STR": {
"type": "string",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]"
},
"AZURE_STORAGE_ACCOUNT": {
"type": "string",
"value": "[variables('storageAccount')]"
},
"AZURE_STORAGE_ACCESS_KEY":{
"type": "string",
"value": "[listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]"
}
}
}
12 changes: 3 additions & 9 deletions sdk/eventhub/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ stages:
parameters:
AllocateResourceGroup: false
ServiceDirectory: eventhub
BuildTargetingString: azure-eventhub*
DeployArmTemplate: true
TestSamples: true
MatrixFilters:
- PythonVersion=^(?!pypy3).*
EnvVars:
AZURE_STORAGE_ACCOUNT: $(python-eh-livetest-event-hub-storage-account)
AZURE_STORAGE_ACCESS_KEY: $(python-eh-livetest-event-hub-storage-access-key)
AZURE_STORAGE_CONN_STR: $(python-eh-livetest-event-hub-storage-conn-str)
AZURE_STORAGE_DATA_LAKE_ENABLED_CONN_STR: $(python-eh-livetest-event-hub-storage-data-lake-enabled-conn-str)
EVENT_HUB_CONN_STR: $(python-eh-livetest-event-hub-conn-str)
EVENT_HUB_HOSTNAME: $(python-eh-livetest-event-hub-hostname)
EVENT_HUB_NAME: $(python-eh-livetest-event-hub-name)
EVENT_HUB_SAS_POLICY: $(python-eh-livetest-event-hub-sas-policy)
EVENT_HUB_SAS_KEY: $(python-eh-livetest-event-hub-sas-key)
EVENT_HUB_NAMESPACE: $(python-eh-livetest-event-hub-namespace)
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)
Expand Down