Skip to content

Commit af7be7c

Browse files
pjcollinsjonathanpeppers
authored andcommitted
[ci] Skip classic tests on .NET release branches (#7312)
Related: #7286 Classic test jobs and VSIX installer provisioning will no longer run on .NET release branches (branches starting with `release/`). The MSBuild smoke test jobs have also been updated to run against the `net6.0` version of the `Xamarin.Android.Build.Tests.dll` and `MSBuildDeviceIntegration.dll` test assemblies.
1 parent 955d36e commit af7be7c

File tree

4 files changed

+38
-29
lines changed

4 files changed

+38
-29
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ stages:
338338
# Check - "Xamarin.Android (macOS > Tests > APKs Classic)"
339339
- job: mac_apk_tests_legacy
340340
displayName: macOS > Tests > APKs Classic
341+
# Disabled on .NET release branches
342+
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')))
341343
pool:
342344
vmImage: $(HostedMacImage)
343345
timeoutInMinutes: 240
@@ -749,20 +751,24 @@ stages:
749751
# Xamarin.Android (Smoke Tests MSBuild - Mac-0)
750752
- template: yaml-templates/run-msbuild-mac-tests.yaml
751753
parameters:
752-
job_name: mac_msbuild_tests_0
753-
nunit_categories: '|| cat == SmokeTests'
754+
job_name: mac_dotnet_tests_0
755+
job_suffix: One .NET
756+
nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))'
757+
target_framework: $(DotNetStableTargetFramework)
754758
provisionatorChannel: ${{ parameters.provisionatorChannel }}
755759

756760
# Xamarin.Android (Smoke Tests MSBuild - Win-0)
757761
- template: yaml-templates\run-msbuild-win-tests.yaml
758762
parameters:
759-
job_name: win_msbuild_tests_0
760-
nunit_categories: '|| cat == SmokeTests'
763+
job_name: win_dotnet_tests_0
764+
job_suffix: One .NET
765+
nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))'
766+
target_framework: $(DotNetStableTargetFramework)
761767
provisionatorChannel: ${{ parameters.provisionatorChannel }}
762768

763769
# Check - "Xamarin.Android (macOS > Tests > MSBuild+Emulator)"
764770
- job: mac_msbuilddevice_tests
765-
displayName: macOS > Tests > MSBuild+Emulator
771+
displayName: macOS > Tests > MSBuild+Emulator One .NET
766772
pool:
767773
vmImage: $(HostedMacImage)
768774
timeoutInMinutes: 90
@@ -793,9 +799,10 @@ stages:
793799

794800
- template: yaml-templates/run-nunit-tests.yaml
795801
parameters:
802+
useDotNet: true
796803
testRunTitle: MSBuildDeviceIntegration Smoke - macOS
797-
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/net472/MSBuildDeviceIntegration.dll
798-
nunitConsoleExtraArgs: --where "cat == SmokeTests"
804+
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
805+
nunitConsoleExtraArgs: --filter "TestCategory = SmokeTests $(DotNetNUnitCategories)"
799806
testResultsFile: TestResult-MSBuildDeviceIntegrationSmoke-$(XA.Build.Configuration).xml
800807

801808
- task: MSBuild@1
@@ -810,7 +817,7 @@ stages:
810817

811818
- template: yaml-templates/upload-results.yaml
812819
parameters:
813-
artifactName: Test Results - MSBuild Smoke With Emulator - macOS
820+
artifactName: Test Results - MSBuild Smoke With Emulator - macOS - One .NET
814821

815822
- template: yaml-templates/fail-on-issue.yaml
816823

@@ -857,23 +864,22 @@ stages:
857864
- stage: msbuild_legacy
858865
displayName: Legacy Tests
859866
dependsOn: mac_build
860-
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuild')))
867+
# Disabled on .NET release branches
868+
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuild')))
861869
jobs:
862870
# Xamarin.Android (Test MSBuild Legacy - macOS)
863871
- template: yaml-templates\run-msbuild-mac-tests.yaml
864872
parameters:
865873
node_id: 1
866874
job_name: mac_msbuild_tests_1
867875
job_suffix: Legacy
868-
nunit_categories: '&& cat != SmokeTests'
869876
provisionatorChannel: ${{ parameters.provisionatorChannel }}
870877

871878
- template: yaml-templates\run-msbuild-mac-tests.yaml
872879
parameters:
873880
node_id: 2
874881
job_name: mac_msbuild_tests_2
875882
job_suffix: Legacy
876-
nunit_categories: '&& cat != SmokeTests'
877883
run_extra_tests: true
878884
provisionatorChannel: ${{ parameters.provisionatorChannel }}
879885

@@ -882,31 +888,27 @@ stages:
882888
node_id: 3
883889
job_name: mac_msbuild_tests_3
884890
job_suffix: Legacy
885-
nunit_categories: '&& cat != SmokeTests'
886891
provisionatorChannel: ${{ parameters.provisionatorChannel }}
887892

888893
- template: yaml-templates\run-msbuild-mac-tests.yaml
889894
parameters:
890895
node_id: 4
891896
job_name: mac_msbuild_tests_4
892897
job_suffix: Legacy
893-
nunit_categories: '&& cat != SmokeTests'
894898
provisionatorChannel: ${{ parameters.provisionatorChannel }}
895899

896900
- template: yaml-templates\run-msbuild-mac-tests.yaml
897901
parameters:
898902
node_id: 5
899903
job_name: mac_msbuild_tests_5
900904
job_suffix: Legacy
901-
nunit_categories: '&& cat != SmokeTests'
902905
provisionatorChannel: ${{ parameters.provisionatorChannel }}
903906

904907
- template: yaml-templates\run-msbuild-mac-tests.yaml
905908
parameters:
906909
node_id: 6
907910
job_name: mac_msbuild_tests_6
908911
job_suffix: Legacy
909-
nunit_categories: '&& cat != SmokeTests'
910912
provisionatorChannel: ${{ parameters.provisionatorChannel }}
911913

912914
# Xamarin.Android (Test MSBuild Legacy - Windows)
@@ -916,7 +918,6 @@ stages:
916918
additional_node_id: 4
917919
job_name: win_msbuild_tests_1
918920
job_suffix: Legacy
919-
nunit_categories: '&& cat != SmokeTests'
920921
provisionatorChannel: ${{ parameters.provisionatorChannel }}
921922

922923
- template: yaml-templates\run-msbuild-win-tests.yaml
@@ -925,7 +926,6 @@ stages:
925926
additional_node_id: 5
926927
job_name: win_msbuild_tests_2
927928
job_suffix: Legacy
928-
nunit_categories: '&& cat != SmokeTests'
929929
run_extra_tests: true
930930
provisionatorChannel: ${{ parameters.provisionatorChannel }}
931931

@@ -935,7 +935,6 @@ stages:
935935
additional_node_id: 6
936936
job_name: win_msbuild_tests_3
937937
job_suffix: Legacy
938-
nunit_categories: '&& cat != SmokeTests'
939938
provisionatorChannel: ${{ parameters.provisionatorChannel }}
940939

941940
- stage: msbuild_dotnet
@@ -949,7 +948,7 @@ stages:
949948
node_id: 1
950949
job_name: mac_dotnet_tests_1
951950
job_suffix: One .NET
952-
nunit_categories: $(DotNetNUnitCategories)
951+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
953952
target_framework: $(DotNetStableTargetFramework)
954953
provisionatorChannel: ${{ parameters.provisionatorChannel }}
955954

@@ -958,7 +957,7 @@ stages:
958957
node_id: 2
959958
job_name: mac_dotnet_tests_2
960959
job_suffix: One .NET
961-
nunit_categories: $(DotNetNUnitCategories)
960+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
962961
target_framework: $(DotNetStableTargetFramework)
963962
provisionatorChannel: ${{ parameters.provisionatorChannel }}
964963

@@ -967,7 +966,7 @@ stages:
967966
node_id: 3
968967
job_name: mac_dotnet_tests_3
969968
job_suffix: One .NET
970-
nunit_categories: $(DotNetNUnitCategories)
969+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
971970
target_framework: $(DotNetStableTargetFramework)
972971
provisionatorChannel: ${{ parameters.provisionatorChannel }}
973972

@@ -976,7 +975,7 @@ stages:
976975
node_id: 4
977976
job_name: mac_dotnet_tests_4
978977
job_suffix: One .NET
979-
nunit_categories: $(DotNetNUnitCategories)
978+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
980979
target_framework: $(DotNetStableTargetFramework)
981980
provisionatorChannel: ${{ parameters.provisionatorChannel }}
982981

@@ -985,7 +984,7 @@ stages:
985984
node_id: 5
986985
job_name: mac_dotnet_tests_5
987986
job_suffix: One .NET
988-
nunit_categories: $(DotNetNUnitCategories)
987+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
989988
target_framework: $(DotNetStableTargetFramework)
990989
provisionatorChannel: ${{ parameters.provisionatorChannel }}
991990

@@ -994,7 +993,7 @@ stages:
994993
node_id: 6
995994
job_name: mac_dotnet_tests_6
996995
job_suffix: One .NET
997-
nunit_categories: $(DotNetNUnitCategories)
996+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
998997
target_framework: $(DotNetStableTargetFramework)
999998
provisionatorChannel: ${{ parameters.provisionatorChannel }}
1000999

@@ -1005,7 +1004,7 @@ stages:
10051004
additional_node_id: 4
10061005
job_name: win_dotnet_tests_1
10071006
job_suffix: One .NET
1008-
nunit_categories: $(DotNetNUnitCategories)
1007+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
10091008
target_framework: $(DotNetStableTargetFramework)
10101009
provisionatorChannel: ${{ parameters.provisionatorChannel }}
10111010

@@ -1015,7 +1014,7 @@ stages:
10151014
additional_node_id: 5
10161015
job_name: win_dotnet_tests_2
10171016
job_suffix: One .NET
1018-
nunit_categories: $(DotNetNUnitCategories)
1017+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
10191018
target_framework: $(DotNetStableTargetFramework)
10201019
provisionatorChannel: ${{ parameters.provisionatorChannel }}
10211020

@@ -1025,7 +1024,7 @@ stages:
10251024
additional_node_id: 6
10261025
job_name: win_dotnet_tests_3
10271026
job_suffix: One .NET
1028-
nunit_categories: $(DotNetNUnitCategories)
1027+
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
10291028
target_framework: $(DotNetStableTargetFramework)
10301029
provisionatorChannel: ${{ parameters.provisionatorChannel }}
10311030

@@ -1042,6 +1041,7 @@ stages:
10421041
job_suffix: Legacy
10431042
nunit_categories: '&& cat != Debugger'
10441043
provisionatorChannel: ${{ parameters.provisionatorChannel }}
1044+
jobCondition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')))
10451045

10461046
- template: yaml-templates/run-msbuild-device-tests.yaml
10471047
parameters:
@@ -1050,6 +1050,7 @@ stages:
10501050
job_suffix: Legacy
10511051
nunit_categories: '&& cat != Debugger'
10521052
provisionatorChannel: ${{ parameters.provisionatorChannel }}
1053+
jobCondition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')))
10531054

10541055
- template: yaml-templates/run-msbuild-device-tests.yaml
10551056
parameters:
@@ -1058,6 +1059,7 @@ stages:
10581059
job_suffix: Legacy
10591060
nunit_categories: '&& cat != Debugger'
10601061
provisionatorChannel: ${{ parameters.provisionatorChannel }}
1062+
jobCondition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')))
10611063

10621064
- template: yaml-templates/run-msbuild-device-tests.yaml
10631065
parameters:
@@ -1067,6 +1069,7 @@ stages:
10671069
jdkTestFolder: $(XA.Jdk11.Folder)
10681070
nunit_categories: '&& cat == Debugger'
10691071
provisionatorChannel: ${{ parameters.provisionatorChannel }}
1072+
jobCondition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')))
10701073

10711074
# Check - "Xamarin.Android (macOS > Tests > MSBuild+Emulator One .NET #N)"
10721075
- template: yaml-templates/run-msbuild-device-tests.yaml
@@ -1348,7 +1351,8 @@ stages:
13481351
- stage: bcl_tests
13491352
displayName: BCL Emulator Tests
13501353
dependsOn: mac_build
1351-
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'BCL')))
1354+
# Disabled on .NET release branches
1355+
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'BCL')))
13521356
jobs:
13531357
# Check - "Xamarin.Android (macOS > Tests > BCL (Emulator))"
13541358
- job: mac_bcl_tests

build-tools/automation/yaml-templates/run-installer.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ steps:
3737
github_token: $(GitHub.Token)
3838
provisioning_script: $(XA.Provisionator.Args)
3939
provisioning_extra_args: ${{ parameters.provisionExtraArgs }}
40-
condition: and(succeeded(), ne(variables['agent.os'], 'Linux'))
40+
# Disabled on Windows on .NET release branches
41+
condition: and(succeeded(), ne(variables['agent.os'], 'Linux'), or(not(startsWith(variables['Build.SourceBranch'], '$(DotNetReleaseBranchPrefix)')), eq(variables['agent.os'], 'Darwin')))
4142
env:
4243
PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}

build-tools/automation/yaml-templates/run-msbuild-device-tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ parameters:
88
target_framework: 'net472'
99
dotnet_targetframework: $(DotNetStableTargetFramework)
1010
provisionatorChannel: latest
11+
jobCondition: succeeded()
1112

1213
jobs:
1314
- job: ${{ parameters.job_name }}
1415
displayName: "macOS > Tests > MSBuild+Emulator ${{ parameters.job_suffix }} #${{ parameters.node_id }}"
16+
condition: ${{ parameters.jobCondition }}
1517
pool:
1618
vmImage: $(HostedMacImage)
1719
timeoutInMinutes: 90

build-tools/automation/yaml-templates/variables.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ variables:
3838
# Workaround: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820
3939
- name: _WriteTelemetryProperties
4040
value: false
41+
- name: DotNetReleaseBranchPrefix
42+
value: refs/heads/release/

0 commit comments

Comments
 (0)