243 строки
7.7 KiB
YAML
243 строки
7.7 KiB
YAML
parameters:
|
|
vmMacOSImage: ''
|
|
vmWindowsImage: ''
|
|
vmLinuxImage: ''
|
|
vmLinuxPool: ''
|
|
xCodeRoot: ''
|
|
|
|
automatedTestsBuckets:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- 4
|
|
- 5
|
|
|
|
runtimeTestsGroups:
|
|
- 0
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- 4
|
|
|
|
jobs:
|
|
|
|
- job: Android_Build_NetCoreMobile_For_Tests
|
|
displayName: 'Build .NET Mobile Android UI Tests'
|
|
|
|
pool:
|
|
vmImage: ${{ parameters.vmMacOSImage }}
|
|
|
|
variables:
|
|
CI_Build: true
|
|
SourceLinkEnabled: false
|
|
NUGET_PACKAGES: $(Agent.WorkFolder)/.nuget
|
|
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
|
|
# Install android 34 as we're running on macos-15
|
|
- bash: |
|
|
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME --install 'platforms;android-34' | tr '\r' '\n' | uniq
|
|
displayName: Install Android 34
|
|
|
|
- template: templates/dotnet-mobile-install-mac.yml
|
|
|
|
- template: templates/nuget-cache.yml
|
|
parameters:
|
|
nugetPackages: $(NUGET_PACKAGES)
|
|
|
|
- template: templates/gitversion.yml
|
|
|
|
- bash: |
|
|
cd $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.netcoremobile
|
|
dotnet publish -f net8.0-android -c Release -p:UnoTargetFrameworkOverride=net8.0-android /bl:$(build.artifactstagingdirectory)/android-netcoremobile-sampleapp.binlog
|
|
displayName: Build Android samples app
|
|
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.netcoremobile/bin/Release/net8.0-android/publish
|
|
Contents: 'uno.platform.unosampleapp-Signed.apk'
|
|
TargetFolder: $(build.artifactstagingdirectory)/android
|
|
CleanTargetFolder: false
|
|
OverWrite: false
|
|
flattenFolders: false
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: always()
|
|
retryCountOnTaskFailure: 3
|
|
inputs:
|
|
PathtoPublish: $(build.artifactstagingdirectory)
|
|
ArtifactName: uitests-android-netcoremobile-build
|
|
ArtifactType: Container
|
|
|
|
- job: Android_Tests
|
|
displayName: 'Run Android UI Tests'
|
|
dependsOn:
|
|
- Android_Build_NetCoreMobile_For_Tests
|
|
|
|
timeoutInMinutes: 45
|
|
cancelTimeoutInMinutes: 1
|
|
|
|
variables:
|
|
CI_Build: true
|
|
SourceLinkEnabled: false
|
|
NUGET_PACKAGES: $(Agent.WorkFolder)/.nuget
|
|
|
|
UNO_UITEST_BUCKET_COUNT: 5
|
|
|
|
pool: ${{ parameters.vmLinuxPool }}
|
|
# vmImage: ${{ parameters.vmLinuxImage }}
|
|
|
|
strategy:
|
|
matrix:
|
|
# Most tests pass, will be enabled in a later PR
|
|
#Android_5.0:
|
|
# ANDROID_SIMULATOR_APILEVEL: 21
|
|
# UITEST_TEST_MODE_NAME: Automated
|
|
|
|
${{ each testBucket in parameters.automatedTestsBuckets }}:
|
|
Android_9.0_Group_${{ testBucket }}_net8:
|
|
ANDROID_SIMULATOR_APILEVEL: 28
|
|
UITEST_TEST_MODE_NAME: Automated
|
|
UNO_UITEST_BUCKET_ID: ${{ testBucket }} ## Note: Align with UNO_UITEST_BUCKET_COUNT
|
|
SAMPLEAPP_ARTIFACT_NAME: uitests-android-netcoremobile-build
|
|
TARGETPLATFORM_NAME: net8
|
|
FAILBUILD_ON_FAILURE: true
|
|
ALLOW_RERUN: true
|
|
UITEST_TEST_TIMEOUT: '270s'
|
|
|
|
${{ each testGroup in parameters.runtimeTestsGroups }}:
|
|
Android_9.0_RuntimeTests_${{ testGroup }}_net8:
|
|
ANDROID_SIMULATOR_APILEVEL: 28
|
|
UITEST_TEST_MODE_NAME: RuntimeTests
|
|
UNO_UITEST_BUCKET_ID: RuntimeTests
|
|
UITEST_RUNTIME_TEST_GROUP: ${{ testGroup }}
|
|
UITEST_RUNTIME_TEST_GROUP_COUNT: 5
|
|
SAMPLEAPP_ARTIFACT_NAME: uitests-android-netcoremobile-build
|
|
TARGETPLATFORM_NAME: net8
|
|
FAILBUILD_ON_FAILURE: true
|
|
ALLOW_RERUN: false
|
|
UITEST_TEST_TIMEOUT: '2600s'
|
|
|
|
Android_9.0_Snapshots_net8:
|
|
ANDROID_SIMULATOR_APILEVEL: 28
|
|
UITEST_TEST_MODE_NAME: Snapshots
|
|
UNO_UITEST_BUCKET_ID: Snapshots
|
|
SAMPLEAPP_ARTIFACT_NAME: uitests-android-netcoremobile-build
|
|
TARGETPLATFORM_NAME: net8
|
|
FAILBUILD_ON_FAILURE: true
|
|
ALLOW_RERUN: true
|
|
UITEST_TEST_TIMEOUT: '270s'
|
|
|
|
# Android 10 testing is disabled because of https://github.com/microsoft/appcenter/issues/1451
|
|
# Android_10.0:
|
|
# ANDROID_SIMULATOR_APILEVEL: 28
|
|
# UITEST_TEST_MODE_NAME: Automated
|
|
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
|
|
- bash: |
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --name-match=kvm
|
|
displayName: 'Enable KVM'
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
displayName: 'Download SamplesApp UnitTests'
|
|
inputs:
|
|
artifactName: $(SAMPLEAPP_ARTIFACT_NAME)
|
|
downloadPath: '$(build.sourcesdirectory)/build'
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
condition: gt(variables['System.JobAttempt'], 1)
|
|
continueOnError: true
|
|
displayName: Download previous test runs failed tests
|
|
inputs:
|
|
artifactName: uitests-failure-results
|
|
downloadPath: '$(build.sourcesdirectory)/build'
|
|
|
|
- template: templates/dotnet-install.yml
|
|
|
|
# - task: PowerShell@2
|
|
# displayName: 'Install coreutils'
|
|
# inputs:
|
|
# targetType: inline
|
|
# script: |
|
|
# brew install coreutils
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Fill Rerun Variable'
|
|
inputs:
|
|
## Expression evaluation for task parameters is not supported
|
|
## Invert ALLOW_RERUN in a task
|
|
targetType: inline
|
|
script: |
|
|
Set-PSDebug -Trace 1
|
|
if( "$(ALLOW_RERUN)" -eq "false") {
|
|
$val = "true"
|
|
} else {
|
|
$val = "false"
|
|
}
|
|
echo "##vso[task.setvariable variable=FAIL_TESTS_ON_NO_RERUN]$val"
|
|
|
|
## First tests run (https://github.com/unoplatform/uno/issues/6714)
|
|
- bash: |
|
|
# always set execute bit, as git has a tendency to remove it
|
|
chmod +x $(build.sourcesdirectory)/build/test-scripts/android-uitest-run.sh
|
|
$(build.sourcesdirectory)/build/test-scripts/android-uitest-run.sh
|
|
|
|
displayName: Run Android Tests
|
|
|
|
- task: PublishTestResults@2
|
|
condition: always()
|
|
inputs:
|
|
testRunTitle: 'Android $(ANDROID_SIMULATOR_APILEVEL) $(UITEST_TEST_MODE_NAME)/$(UNO_UITEST_BUCKET_ID)/$(TARGETPLATFORM_NAME)/$(UITEST_RUNTIME_TEST_GROUP) Test Run (FAIL_TESTS_ON_NO_RERUN $(FAIL_TESTS_ON_NO_RERUN))'
|
|
testResultsFormat: 'NUnit'
|
|
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult-original.xml'
|
|
# don't fail on failed tests, second run will do it
|
|
# see https://github.com/unoplatform/uno/issues/6714
|
|
failTaskOnFailedTests: $(FAIL_TESTS_ON_NO_RERUN)
|
|
|
|
## Second tests run (https://github.com/unoplatform/uno/issues/6714)
|
|
- bash: |
|
|
$(build.sourcesdirectory)/build/test-scripts/android-uitest-run.sh
|
|
|
|
displayName: Run Android Tests
|
|
condition: eq(variables.ALLOW_RERUN, 'true')
|
|
|
|
- task: PublishTestResults@2
|
|
condition: eq(variables.ALLOW_RERUN, 'true')
|
|
inputs:
|
|
testRunTitle: 'Android $(ANDROID_SIMULATOR_APILEVEL) $(UITEST_TEST_MODE_NAME)/$(UNO_UITEST_BUCKET_ID)/$(TARGETPLATFORM_NAME) Test ReRun'
|
|
testResultsFormat: 'NUnit'
|
|
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult-original.xml'
|
|
failTaskOnFailedTests: $(FAILBUILD_ON_FAILURE)
|
|
## end second run
|
|
|
|
- task: PublishTestResults@2
|
|
condition: always()
|
|
inputs:
|
|
testResultsFiles: '$(build.sourcesdirectory)/build/RuntimeTestResults*.xml'
|
|
testRunTitle: 'Android $(ANDROID_SIMULATOR_APILEVEL) $(TARGETPLATFORM_NAME) Runtime Tests Run'
|
|
testResultsFormat: 'NUnit'
|
|
failTaskOnFailedTests: $(FAILBUILD_ON_FAILURE)
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: always()
|
|
retryCountOnTaskFailure: 3
|
|
inputs:
|
|
PathtoPublish: $(build.artifactstagingdirectory)
|
|
ArtifactName: uitests-results
|
|
ArtifactType: Container
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: always()
|
|
retryCountOnTaskFailure: 3
|
|
inputs:
|
|
PathtoPublish: $(build.sourcesdirectory)/build/uitests-failure-results
|
|
ArtifactName: uitests-failure-results
|
|
ArtifactType: Container
|