You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
# Service Bus Extension for Azure Functions guide to running integration tests locally
2
+
Integration tests are implemented in the `EndToEndTests` and `SessionsEndToEndTests` classes and require special configuration to execute locally in Visual Studio or via dotnet test.
3
+
4
+
All configuration is done via a json file called `appsettings.tests` which on windows should be located in the `%USERPROFILE%\.azurefunctions` folder (e.g. `C:\Users\user123\.azurefunctions`)
5
+
6
+
**Note:***The specifics of the configuration will change when the validation code is modified so check the code for the latest configuration if the tests do not pass as this readme file may not have been updated with each code change.*
7
+
8
+
Create the appropriate Azure resources if needed as explained below and create or update the `appsettings.tests` file in the location specified above by copying the configuration below and replacing all the `PLACEHOLDER` values
9
+
10
+
appsettings.tests contents
11
+
```
12
+
{
13
+
"ConnectionStrings": {
14
+
"ServiceBus": "PLACEHOLDER",
15
+
"ServiceBusSecondary": "PLACEHOLDER"
16
+
},
17
+
"AzureWebJobsStorage": "PLACEHOLDER"
18
+
}
19
+
```
20
+
Create a storage account and configure its connection string into `AzureWebJobsStorage`. This will be used by the webjobs hosts created by the tests.
21
+
22
+
Create two service bus namespaces and configure their connection strings in `ConnectionStrings:ServiceBus` and `ConnectionStrings:ServiceBusSecondary`.
23
+
1. In the namespace configured into `ConnectionStrings:ServiceBus`, create queues with the following names:
24
+
1.`core-test-queue1`
25
+
2.`core-test-queue2`
26
+
3.`core-test-queue3`
27
+
4.`core-test-queue1-sessions` (enable sessions when creating)
28
+
2. In the namespace configured into `ConnectionStrings:ServiceBus`, create topics and subscriptions with the following names:
29
+
1.`core-test-topic1` with two subscriptions: `sub1` and `sub2`
30
+
2.`core-test-topic1-sessions` with one subscription: `sub1-sessions` (enable sessions in the subscription when creating)
31
+
2. In the namespace configured into `ConnectionStrings:ServiceBusSecondary`, create queues with the following names:
32
+
1.`core-test-queue1`
33
+
34
+
Change the message lock duration setting on all queues and subscriptions to 5 minutes to all for delays associated with stepping through code in debug mode.
0 commit comments