Skip to content

Commit

Permalink
Fix Service Bus test environment (#45969)
Browse files Browse the repository at this point in the history
* Fix Service Bus test env

* Update ci.functions.yml

* Update ci.functions.yml
  • Loading branch information
m-redding authored Sep 13, 2024
1 parent 23094ab commit 2121570
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ public class ServiceBusTestEnvironment : TestEnvironment
/// <summary>The active Service Bus namespace for this test run.</summary>
private ServiceBusConnectionStringProperties ParsedConnectionString => ServiceBusConnectionStringProperties.Parse(ServiceBusConnectionString);

/// <summary>
/// The connection string for the premium Service Bus namespace instance to be used for
/// Live tests.
/// </summary>
///
/// <value>The connection string will be determined by creating an ephemeral Service Bus namespace for the test execution.</value>
///
public string ServiceBusPremiumNamespaceConnectionString => GetRecordedVariable(
"SERVICEBUS_PREMIUM_NAMESPACE_CONNECTION_STRING",
options => options.HasSecretConnectionStringParameter("SharedAccessKey", SanitizedValue.Base64));

/// <summary>
/// The connection string for the secondary Service Bus namespace instance to be used for
/// Live tests.
/// </summary>
///
/// <value>The connection string will be determined by creating an ephemeral Service Bus namespace for the test execution.</value>
///
public string ServiceBusSecondaryNamespaceConnectionString => GetRecordedVariable(
"SERVICEBUS_SECONDARY_NAMESPACE_CONNECTION_STRING",
options => options.HasSecretConnectionStringParameter("SharedAccessKey", SanitizedValue.Base64));

/// <summary>
/// The connection string for the Service Bus namespace instance to be used for
/// Live tests.
Expand Down
2 changes: 2 additions & 0 deletions sdk/servicebus/ci.functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ trigger:
- sdk/servicebus/service.projects
- sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus
- sdk/servicebus/ci.functions.yml
- sdk/servicebus/Azure.Messaging.ServiceBus/tests/Infrastructure
- sdk/servicebus/test-resources.json

pr:
branches:
Expand Down
8 changes: 8 additions & 0 deletions sdk/servicebus/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,18 @@
"type": "string",
"value": "[listkeys(variables('authRuleResourceId'), variables('sbVersion')).primaryConnectionString]"
},
"SERVICEBUS_SECONDARY_NAMESPACE_CONNECTION_STRING": {
"type": "string",
"value": "[listkeys(variables('authRuleSecondaryResourceId'), variables('sbVersion')).primaryConnectionString]"
},
"SERVICEBUS_SECONDARY_FULLY_QUALIFIED_NAMESPACE": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusSecondaryNamespace'))).serviceBusEndpoint]"
},
"SERVICEBUS_PREMIUM_NAMESPACE_CONNECTION_STRING": {
"type": "string",
"value": "[listkeys(variables('authRulePremiumResourceId'), variables('sbVersion')).primaryConnectionString]"
},
"SERVICEBUS_PREMIUM_FULLY_QUALIFIED_NAMESPACE": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusPremiumNamespace'))).serviceBusEndpoint]"
Expand Down

0 comments on commit 2121570

Please sign in to comment.