Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Communication] - Divide live test pipeline for each SDK #20902

Merged
merged 15 commits into from
May 11, 2021
4 changes: 4 additions & 0 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ parameters:
- name: ServiceDirectory
type: string
default: not-specified
- name: Project
type: string
default: '**'
- name: TestSetupSteps
type: stepList
default: []
Expand Down Expand Up @@ -112,6 +115,7 @@ jobs:
--logger:"console;verbosity=normal"
/p:SDKType=${{ parameters.SDKType }}
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
/p:Project=${{ parameters.Project }}
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
/p:BuildInParallel=${{ parameters.BuildInParallel }}
$(AdditionalTestArguments)
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ parameters:
- name: ServiceDirectory
type: string
default: not-specified
- name: Project
type: string
default: '**'
- name: TestSetupSteps
type: stepList
default: []
Expand Down Expand Up @@ -124,6 +127,7 @@ stages:
Location: ${{ parameters.Location }}
SDKType: ${{ parameters.SDKType }}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Project: ${{ parameters.Project }}
TestSetupSteps: ${{ parameters.TestSetupSteps }}
MatrixConfigs:
# Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix).
Expand Down
13 changes: 7 additions & 6 deletions eng/service.proj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<SDKType Condition="'$(SDKType)' == ''">all</SDKType>
<ServiceDirectory Condition="'$(ServiceDirectory)' == '' and '$(Scope)' != ''">$(Scope)</ServiceDirectory>
<ServiceDirectory Condition="'$(ServiceDirectory)' == ''">*</ServiceDirectory>
<Project Condition="'$(Project)' == ''">**</Project>
<IncludeTests Condition="'$(IncludeTests)' == ''">true</IncludeTests>
<IncludeSrc Condition="'$(IncludeSrc)' == ''">true</IncludeSrc>
<IncludeSamples Condition="'$(IncludeSamples)' == ''">true</IncludeSamples>
Expand All @@ -14,12 +15,12 @@

<ItemGroup>
<MgmtExcludePaths Include="$(MSBuildThisFileDirectory)..\sdk\*\Microsoft.*.Management.*\**\*.csproj;$(MSBuildThisFileDirectory)..\sdk\*mgmt*\**\*.csproj" />
<TestProjects Include="..\sdk\$(ServiceDirectory)\**\tests\**\*.csproj" />
<SamplesProjects Include="..\sdk\$(ServiceDirectory)\**\samples\**\*.csproj" />
<PerfProjects Include="..\sdk\$(ServiceDirectory)\**\perf\**\*.csproj" />
<StressProjects Include="..\sdk\$(ServiceDirectory)\**\stress\**\*.csproj" />
<TestProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\tests\**\*.csproj" />
<SamplesProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\samples\**\*.csproj" />
<PerfProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\perf\**\*.csproj" />
<StressProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\stress\**\*.csproj" />
<SampleApplications Include="..\samples\**\*.csproj" />
<SrcProjects Include="..\sdk\$(ServiceDirectory)\**\*.csproj" Exclude="@(TestProjects);@(SamplesProjects)"/>
<SrcProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\*.csproj" Exclude="@(TestProjects);@(SamplesProjects)"/>
<ProjectReference Include="@(TestProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeTests)' == 'true'" />
<ProjectReference Include="@(SamplesProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeSamples)' == 'true'" />
<ProjectReference Include="@(PerfProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludePerf)' == 'true'" />
Expand All @@ -39,7 +40,7 @@
<Target Name="CheckProjects" AfterTargets="Build">
<!-- If scope is set this likely came from a call to build.proj and in cases where there is only mgmt projects we don't want to error so skip this extra check -->
<Error Condition="'$(Scope)' == '' and '@(ProjectReference)' == ''"
Text="No Projects found with patttern [..\sdk\$(ServiceDirectory)\**\*.csproj], please make sure you have passed in the correct ServiceDirectory." />
Text="No Projects found with patttern [..\sdk\$(ServiceDirectory)\$(Project)\*.csproj], please make sure you have passed in the correct ServiceDirectory." />
</Target>

<Target Name="GenerateCode">
Expand Down
17 changes: 17 additions & 0 deletions sdk/communication/Azure.Communication.Chat/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger: none
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a plan to also remove the tests.yml file in the root of the communications service folder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the plan once we create the new pipelines and make sure that everything is working as expected


extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: communication
Project: Azure.Communication.Chat
CloudConfig:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benbp do you think it is worth having a communication level template to capture some of this duplication?

Public:
SubscriptionConfigurations:
- $(sub-config-azure-cloud-test-resources)
- $(sub-config-communication-services-cloud-test-resources-common)
- $(sub-config-communication-services-cloud-test-resources-net)
Clouds: Public
EnvVars:
# SKIP_PHONENUMBER_LIVE_TESTS skips certain phone number tests such as purchase and release
SKIP_PHONENUMBER_LIVE_TESTS: TRUE
17 changes: 17 additions & 0 deletions sdk/communication/Azure.Communication.Identity/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger: none

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: communication
Project: Azure.Communication.Identity
CloudConfig:
Public:
SubscriptionConfigurations:
- $(sub-config-azure-cloud-test-resources)
- $(sub-config-communication-services-cloud-test-resources-common)
- $(sub-config-communication-services-cloud-test-resources-net)
Clouds: Public
EnvVars:
# SKIP_PHONENUMBER_LIVE_TESTS skips certain phone number tests such as purchase and release
SKIP_PHONENUMBER_LIVE_TESTS: TRUE
17 changes: 17 additions & 0 deletions sdk/communication/Azure.Communication.PhoneNumbers/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger: none

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: communication
Project: Azure.Communication.PhoneNumbers
CloudConfig:
Public:
SubscriptionConfigurations:
- $(sub-config-azure-cloud-test-resources)
- $(sub-config-communication-services-cloud-test-resources-common)
- $(sub-config-communication-services-cloud-test-resources-net)
Clouds: Public
EnvVars:
# SKIP_PHONENUMBER_LIVE_TESTS skips certain phone number tests such as purchase and release
SKIP_PHONENUMBER_LIVE_TESTS: TRUE
17 changes: 17 additions & 0 deletions sdk/communication/Azure.Communication.Sms/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger: none

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: communication
Project: Azure.Communication.Sms
CloudConfig:
Public:
SubscriptionConfigurations:
- $(sub-config-azure-cloud-test-resources)
- $(sub-config-communication-services-cloud-test-resources-common)
- $(sub-config-communication-services-cloud-test-resources-net)
Clouds: Public
EnvVars:
# SKIP_PHONENUMBER_LIVE_TESTS skips certain phone number tests such as purchase and release
SKIP_PHONENUMBER_LIVE_TESTS: TRUE