Skip to content

Commit 0629108

Browse files
authored
allow filtering live test sets based on package name (Azure#18013)
### Description: #### What We want to have the ability to trigger live tests separately for different packages #### How Set runtime parameters ```Services``` at the test YAML file. Based on [recommendations ](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/keyvault/tests.yml)from sys engineering team, add in test filtering logic based on package name so that developers can override [ run parameters from the pipeline ](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script). By default, all packages will be built and tested. ### Test: * Run [all packages](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=842788&view=results) * Run [a selected package](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=842906&view=results)
1 parent 7fe58e9 commit 0629108

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

sdk/communication/tests.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
trigger: none
22

3+
parameters:
4+
- name: TestPackagesEnabled
5+
type: object
6+
default:
7+
- identity
8+
- chat
9+
- phonenumbers
10+
- sms
11+
- mgmt
12+
313
stages:
4-
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
5-
parameters:
6-
AllocateResourceGroup: 'false'
7-
BuildTargetingString: $(BuildTargetingString)
8-
ServiceDirectory: communication
9-
DeployArmTemplate: true
10-
EnvVars:
11-
AZURE_TEST_RUN_LIVE: 'true'
12-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
13-
AZURE_SUBSCRIPTION_ID: $(acs-subscription-id)
14-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
15-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
16-
AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING: $(communication-livetest-connection-string)
17-
AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER: $(communication-livetest-phone-number)
14+
- ${{ each package in parameters.TestPackagesEnabled }}:
15+
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
16+
parameters:
17+
AllocateResourceGroup: 'false'
18+
${{ if ne(package, 'mgmt') }}:
19+
BuildTargetingString: ${{ format('azure-communication-{0}', package) }}
20+
${{ if eq(package, 'mgmt') }}:
21+
BuildTargetingString: 'azure-mgmt-communication'
22+
JobName: ${{ package }}
23+
ServiceDirectory: communication
24+
DeployArmTemplate: true
25+
EnvVars:
26+
AZURE_TEST_RUN_LIVE: 'true'
27+
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
28+
AZURE_SUBSCRIPTION_ID: $(acs-subscription-id)
29+
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
30+
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
31+
AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING: $(communication-livetest-connection-string)
32+
AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER: $(communication-livetest-phone-number)

0 commit comments

Comments
 (0)