Skip to content

Commit 208d919

Browse files
authored
Add properties for device tests to configure release/debug (#25096)
* Run Some Builds as Release * Add retry count on task failure * Change iOS configuration to Debug
1 parent 72de3c9 commit 208d919

File tree

3 files changed

+32
-37
lines changed

3 files changed

+32
-37
lines changed

eng/pipelines/common/device-tests-steps.yml

+15-36
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
device: '' # the xharness device to use
55
apiversion: '' # the iOS device api version to use
66
cakeArgs: '' # additional cake args
7-
androidConfiguration: '' # Indicates the configuration to use for Android. We're slowly enabling this for all projects
7+
deviceTestConfiguration: '' # Indicates the configuration to use for Android. We're slowly enabling this for all projects
88
provisionatorChannel: 'latest'
99
agentPoolAccessToken: ''
1010
artifactName: 'nuget'
@@ -95,41 +95,20 @@ steps:
9595
continueOnError: true
9696
timeoutInMinutes: 5
9797
98-
# Everything should be release but doing android for now to work around an xharness issue
99-
- ${{ if eq(parameters.platform, 'android')}}:
100-
- pwsh: |
101-
./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} --configuration=${{ parameters.androidConfiguration }}
102-
displayName: $(Agent.JobName)
103-
workingDirectory: ${{ parameters.checkoutDirectory }}
104-
condition: and(succeeded(), ne(variables['Platform.Name'], 'Mac'))
105-
retryCountOnTaskFailure: 1
106-
107-
- ${{ if eq(parameters.platform, 'android')}}:
108-
- bash: |
109-
# Execute the powershell script from a bash shell on Mac to avoid interference between powershell processes that lead to this error: The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/bin/pwsh'. This may indicate a child process inherited the STDIO streams and has not yet exited.
110-
pwsh ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} --configuration=${{ parameters.androidConfiguration }}
111-
displayName: $(Agent.JobName)
112-
workingDirectory: ${{ parameters.checkoutDirectory }}
113-
condition: and(succeeded(), eq(variables['Platform.Name'], 'Mac'))
114-
retryCountOnTaskFailure: 1
115-
116-
- ${{ if ne(parameters.platform, 'android')}}:
117-
- pwsh: |
118-
./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
119-
displayName: $(Agent.JobName)
120-
workingDirectory: ${{ parameters.checkoutDirectory }}
121-
condition: and(succeeded(), ne(variables['Platform.Name'], 'Mac'))
122-
retryCountOnTaskFailure: 1
123-
124-
- ${{ if ne(parameters.platform, 'android')}}:
125-
- bash: |
126-
# Execute the powershell script from a bash shell on Mac to avoid interference between powershell processes that lead to this error: The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/bin/pwsh'. This may indicate a child process inherited the STDIO streams and has not yet exited.
127-
pwsh ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
128-
displayName: $(Agent.JobName)
129-
workingDirectory: ${{ parameters.checkoutDirectory }}
130-
condition: and(succeeded(), eq(variables['Platform.Name'], 'Mac'))
131-
retryCountOnTaskFailure: 1
132-
# Everything should be release but doing android for now to work around an xharness issue
98+
- pwsh: |
99+
./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} --configuration=${{ parameters.deviceTestConfiguration }}
100+
displayName: $(Agent.JobName)
101+
workingDirectory: ${{ parameters.checkoutDirectory }}
102+
condition: and(succeeded(), ne(variables['Platform.Name'], 'Mac'))
103+
retryCountOnTaskFailure: 1
104+
105+
- bash: |
106+
# Execute the powershell script from a bash shell on Mac to avoid interference between powershell processes that lead to this error: The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/bin/pwsh'. This may indicate a child process inherited the STDIO streams and has not yet exited.
107+
pwsh ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} --configuration=${{ parameters.deviceTestConfiguration }}
108+
displayName: $(Agent.JobName)
109+
workingDirectory: ${{ parameters.checkoutDirectory }}
110+
condition: and(succeeded(), eq(variables['Platform.Name'], 'Mac'))
111+
retryCountOnTaskFailure: 1
133112
134113
- ${{ if eq(parameters.platform, 'ios')}}:
135114
- bash: |

eng/pipelines/common/device-tests.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ stages:
7373
checkoutDirectory: ${{ parameters.checkoutDirectory }}
7474
useArtifacts: ${{ parameters.useArtifacts }}
7575
poolName: ${{ parameters.androidPool.name }}
76-
androidConfiguration: $(ANDROID_CONFIGURATION)
76+
deviceTestConfiguration: $(ANDROID_CONFIGURATION)
7777
skipProvisioning: ${{ parameters.skipProvisioning }}
7878

7979
- stage: ios_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
@@ -100,6 +100,7 @@ stages:
100100
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}:
101101
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
102102
PROJECT_PATH: ${{ project.ios }}
103+
IOS_CONFIGURATION: ${{ project.iOSConfiguration }}
103104
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
104105
${{ if contains(version, 'device') }}:
105106
DEVICE: ios-device
@@ -123,6 +124,7 @@ stages:
123124
useArtifacts: ${{ parameters.useArtifacts }}
124125
poolName: 'Azure Pipelines'
125126
skipProvisioning: ${{ parameters.skipProvisioning }}
127+
deviceTestConfiguration: $(IOS_CONFIGURATION)
126128

127129
- stage: catalyst_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
128130
displayName: ${{ parameters.targetFrameworkVersion.tfm }} macOS Device Tests
@@ -148,6 +150,7 @@ stages:
148150
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}:
149151
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
150152
PROJECT_PATH: ${{ project.catalyst }}
153+
IOS_CONFIGURATION: ${{ project.iOSConfiguration }}
151154
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
152155
${{ if eq(version, 'latest') }}:
153156
DEVICE: maccatalyst
@@ -169,6 +172,7 @@ stages:
169172
useArtifacts: ${{ parameters.useArtifacts }}
170173
poolName: 'Azure Pipelines'
171174
skipProvisioning: ${{ parameters.skipProvisioning }}
175+
deviceTestConfiguration: $(IOS_CONFIGURATION)
172176

173177

174178
- stage: windows_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
@@ -196,6 +200,7 @@ stages:
196200
PACKAGE_ID: ${{ project.windowsPackageId }}
197201
DEVICE: ${{ version }}
198202
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
203+
WINDOWS_CONFIGURATION: ${{ project.windowsConfiguration }}
199204
steps:
200205
- template: device-tests-steps.yml
201206
parameters:
@@ -211,3 +216,4 @@ stages:
211216
checkoutDirectory: ${{ parameters.checkoutDirectory }}
212217
useArtifacts: ${{ parameters.useArtifacts }}
213218
skipProvisioning: ${{ parameters.skipProvisioning }}
219+
deviceTestConfiguration: $(WINDOWS_CONFIGURATION)

eng/pipelines/device-tests.yml

+10
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ stages:
140140
desc: Essentials
141141
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
142142
androidConfiguration: 'Release'
143+
iOSConfiguration: 'Debug'
144+
windowsConfiguration: 'Debug'
143145
windowsPackageId: 'com.microsoft.maui.essentials.devicetests'
144146
android: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj
145147
ios: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj
@@ -149,6 +151,8 @@ stages:
149151
desc: Graphics
150152
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
151153
androidConfiguration: 'Release'
154+
iOSConfiguration: 'Debug'
155+
windowsConfiguration: 'Debug'
152156
windowsPackageId: 'com.microsoft.maui.graphics.devicetests'
153157
android: $(System.DefaultWorkingDirectory)/src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj
154158
ios: $(System.DefaultWorkingDirectory)/src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj
@@ -158,6 +162,8 @@ stages:
158162
desc: Core
159163
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
160164
androidConfiguration: 'Release'
165+
iOSConfiguration: 'Debug'
166+
windowsConfiguration: 'Debug'
161167
windowsPackageId: 'com.microsoft.maui.core.devicetests'
162168
android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
163169
ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj
@@ -167,6 +173,8 @@ stages:
167173
desc: Controls
168174
androidApiLevelsExclude: [27, 25] # Ignore for now API25 since the runs's are not stable
169175
androidConfiguration: 'Debug'
176+
iOSConfiguration: 'Debug'
177+
windowsConfiguration: 'Debug'
170178
windowsPackageId: 'com.microsoft.maui.controls.devicetests'
171179
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
172180
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
@@ -176,6 +184,8 @@ stages:
176184
desc: BlazorWebView
177185
androidApiLevelsExclude: [ 30, 29, 28, 27, 26, 25, 24, 23, 22, 21 ] # BlazorWebView requires a recent version of Chrome
178186
androidConfiguration: 'Release'
187+
iOSConfiguration: 'Debug'
188+
windowsConfiguration: 'Debug'
179189
windowsPackageId: 'Microsoft.Maui.MauiBlazorWebView.DeviceTests'
180190
android: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj
181191
ios: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj

0 commit comments

Comments
 (0)