Skip to content

Commit 87df03a

Browse files
committed
[ci] Run nunit tests with stable .NET version
1 parent a65c8d8 commit 87df03a

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ stages:
497497

498498
- template: yaml-templates/run-nunit-tests.yaml
499499
parameters:
500-
useDotNet: true
501500
testRunTitle: MSBuildDeviceIntegration Smoke - macOS
502501
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
503502
dotNetTestExtraArgs: --filter "TestCategory = SmokeTests $(DotNetNUnitCategories)"
@@ -546,7 +545,6 @@ stages:
546545

547546
- template: yaml-templates/run-nunit-tests.yaml
548547
parameters:
549-
useDotNet: true
550548
testRunTitle: Xamarin.Android.Build.Tests - Linux .NET 6 Smoke Tests
551549
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
552550
dotNetTestExtraArgs: --filter "TestCategory = SmokeTests $(DotNetNUnitCategories)"
@@ -739,7 +737,6 @@ stages:
739737

740738
- template: yaml-templates/run-nunit-tests.yaml
741739
parameters:
742-
useDotNet: true
743740
testRunTitle: WearOS On Device - macOS
744741
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
745742
dotNetTestExtraArgs: --filter "TestCategory = WearOS"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ stages:
116116

117117
- template: run-nunit-tests.yaml
118118
parameters:
119+
useDotNet: false
119120
testRunTitle: Smoke MSBuild Tests - Windows Build Tree
120121
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\net472\Xamarin.Android.Build.Tests.dll
121122
testResultsFile: TestResult-SmokeMSBuildTests-WinBuildTree-$(XA.Build.Configuration).xml
122123
nunitConsoleExtraArgs: --where "cat == SmokeTests"
123124

124125
- template: run-nunit-tests.yaml
125126
parameters:
126-
useDotNet: true
127127
testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build
128128
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll
129129
testResultsFile: TestResult-SmokeMSBuildTests-WinDotnetBuild-$(XA.Build.Configuration).xml

build-tools/automation/yaml-templates/run-localization-tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
parameters:
3737
testRunTitle: LocalizationTests On Device - macOS
3838
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
39-
useDotNet: true
4039
dotNetTestExtraArgs: --filter "Name~CheckLocalizationIsCorrectNode${{ parameters.node_id }}"
4140
testResultsFile: TestResult-LocalizationTests-Node${{ parameters.node_id }}-$(XA.Build.Configuration).xml
4241

build-tools/automation/yaml-templates/run-nunit-tests.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ parameters:
66
testResultsFile: TestResult.xml
77
nunitConsoleExtraArgs: ''
88
dotNetTestExtraArgs: ''
9-
useDotNet: false
9+
useDotNet: true
10+
useDotNetPreview: false
1011
workers: $(NUnit.NumberOfTestWorkers)
1112
condition: succeeded()
13+
timeoutInMinutes: 0
14+
retryCountOnTaskFailure: 0
1215

1316
steps:
14-
- ${{ if eq(parameters.useDotNet, false) }}:
17+
- ${{ if and(eq(parameters.useDotNet, false), eq(parameters.useDotNetPreview, false)) }}:
1518
- powershell: |
1619
Write-Host '##vso[task.setvariable variable=TestResultsFormat]NUnit'
1720
if ([Environment]::OSVersion.Platform -eq "Unix") {
@@ -28,7 +31,7 @@ steps:
2831
condition: ${{ parameters.condition }}
2932
continueOnError: true
3033
31-
- ${{ if eq(parameters.useDotNet, true) }}:
34+
- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, true)) }}:
3235
- powershell: Write-Host '##vso[task.setvariable variable=TestResultsFormat]VSTest'
3336
- template: run-dotnet-preview.yaml
3437
parameters:
@@ -43,11 +46,24 @@ steps:
4346
displayName: run ${{ parameters.testRunTitle }}
4447
condition: ${{ parameters.condition }}
4548

49+
- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, false)) }}:
50+
- task: DotNetCoreCLI@2
51+
inputs:
52+
command: custom
53+
custom: test ${{ parameters.testAssembly }} ${{ parameters.dotNetTestExtraArgs }} -- NUnit.NumberOfTestWorkers=${{ parameters.workers }}
54+
publishTestResults: true
55+
testRunTitle: ${{ parameters.testRunTitle }}
56+
displayName: run ${{ parameters.testRunTitle }}
57+
condition: ${{ parameters.condition }}
58+
continueOnError: true
59+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
60+
retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }}
61+
4662
- template: kill-processes.yaml
4763

4864
- task: PublishTestResults@2
4965
inputs:
5066
testResultsFormat: $(TestResultsFormat)
5167
testResultsFiles: ${{ parameters.testResultsFile }}
5268
testRunTitle: ${{ parameters.testRunTitle }}
53-
condition: ${{ parameters.condition }}
69+
condition: and(${{ parameters.condition }}, eq('${{ parameters.useDotNet }}', 'true'), eq('${{ parameters.useDotNetPreview }}', 'false'))

build-tools/automation/yaml-templates/run-timezoneinfo-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
3535
- template: run-nunit-tests.yaml
3636
parameters:
37+
useDotNet: false
3738
testRunTitle: TimeZoneInfoTests On Device - macOS
3839
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/net472/MSBuildDeviceIntegration.dll
3940
nunitConsoleExtraArgs: --where "test == Xamarin.Android.Build.Tests.DeploymentTest.CheckTimeZoneInfoIsCorrectNode${{ parameters.node_id }}"

0 commit comments

Comments
 (0)