-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup scaffolding for legacy test runner (#21423)
* Just added a couple of tests * Focus on Android and iOS (for now) * Added legacy tests to the pipeline * More changes * More changes * Fixed build * Created ui-tests-legacy-steps.yml * More changes * More changes * Updated Appium to RC7 * Update ui-tests.yml * Fixed test on Android * Fixed test * More changes * More changes * Updated snapshot * More fixes * Clean code * Run test only on iOS * Added pending constant * Fix build error * More changes * Update ControlGallery.iOS.Appium.UITests.csproj * Update ControlGallery.Shared.Appium.UITests.csproj * Trying to run only on iOS * This is the fix, I feel it * Fix merge error --------- Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
- Loading branch information
1 parent
be17057
commit 632080a
Showing
27 changed files
with
1,396 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
parameters: | ||
platform: '' # [ android, ios, windows, catalyst ] | ||
path: '' # path to csproj | ||
device: '' # the xharness device to use | ||
cakeArgs: '' # additional cake args | ||
app: '' #path to app to test | ||
version: '' #the iOS version' | ||
provisionatorChannel: 'latest' | ||
agentPoolAccessToken: '' | ||
targetSample: "dotnet-legacy-controlgallery" | ||
configuration : "Release" | ||
|
||
steps: | ||
- ${{ if eq(parameters.platform, 'ios')}}: | ||
- bash: | | ||
chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh | ||
$(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh | ||
displayName: 'Clean bot' | ||
continueOnError: true | ||
timeoutInMinutes: 60 | ||
- template: provision.yml | ||
parameters: | ||
skipProvisioning: ${{ eq(parameters.platform, 'windows') }} | ||
skipAndroidSdks: ${{ ne(parameters.platform, 'android') }} | ||
skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} | ||
provisionatorChannel: ${{ parameters.provisionatorChannel }} | ||
|
||
- task: PowerShell@2 | ||
condition: ne('${{ parameters.platform }}' , 'windows') | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
defaults write -g NSAutomaticCapitalizationEnabled -bool false | ||
defaults write -g NSAutomaticTextCompletionEnabled -bool false | ||
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false | ||
displayName: "Modify defaults" | ||
continueOnError: true | ||
|
||
# AzDO hosted agents default to 1024x768; set something bigger for Windows UI tests | ||
- task: ScreenResolutionUtility@1 | ||
condition: eq('${{ parameters.platform }}' , 'windows') | ||
inputs: | ||
displaySettings: 'specific' | ||
width: '1920' | ||
height: '1080' | ||
displayName: "Set screen resolution" | ||
|
||
- task: UseNode@1 | ||
inputs: | ||
version: "20.3.1" | ||
displayName: "Install node" | ||
|
||
- bash: | | ||
echo "##[group]Running ls -al $(npm root -g)" | ||
ls -al $(npm root -g) | ||
echo "##[endgroup]" | ||
echo "##[group]Running ls -al $(npm root -g)/appium" | ||
ls -al $(npm root -g)/appium | ||
echo "##[endgroup]" | ||
echo "##[group]Running ls -al $(npm root -g)/.appium-????????" | ||
ls -al $(npm root -g)/.appium-???????? | ||
echo "##[endgroup]" | ||
echo "##[group]Running ls -al $(npm root -g)/appium-doctor" | ||
ls -al $(npm root -g)/appium-doctor | ||
echo "##[endgroup]" | ||
echo "##[group]Running ls -al $(npm root -g)/.appium-doctor-????????" | ||
ls -al $(npm root -g)/.appium-doctor-???????? | ||
echo "##[endgroup]" | ||
echo "##[group]Running ps aux" | ||
ps aux | ||
echo "##[endgroup]" | ||
displayName: "Debugging output" | ||
continueOnError: true | ||
condition: startsWith(variables['Agent.Name'], 'XAMBOT') | ||
# Clean up any leftover cached folders of appium and appium-doctor node modules | ||
- bash: | | ||
rm -rf $(npm root -g)/.appium-???????? | ||
rm -rf $(npm root -g)/.appium-doctor-???????? | ||
displayName: "Delete temp .appium-???????? and .appium-doctor-???????? folders" | ||
continueOnError: true | ||
- pwsh: ./eng/scripts/appium-install.ps1 | ||
displayName: "Install Appium (Drivers)" | ||
continueOnError: false | ||
retryCountOnTaskFailure: 1 | ||
|
||
- pwsh: ./build.ps1 --target=dotnet --configuration="${{ parameters.configuration }}" --verbosity=diagnostic | ||
displayName: 'Install .NET' | ||
retryCountOnTaskFailure: 2 | ||
env: | ||
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) | ||
PRIVATE_BUILD: $(PrivateBuild) | ||
|
||
- pwsh: echo "##vso[task.prependpath]$(DotNet.Dir)" | ||
displayName: 'Add .NET to PATH' | ||
|
||
- pwsh: ./build.ps1 --target=dotnet-buildtasks --configuration="${{ parameters.configuration }}" | ||
displayName: 'Build the MSBuild Tasks' | ||
|
||
- pwsh: ./build.ps1 --target=${{ parameters.targetSample }} --configuration="${{ parameters.configuration }}" --${{ parameters.platform }} --verbosity=diagnostic --usenuget=false | ||
displayName: 'Build the Legacy ControlGallery' | ||
|
||
- bash: | | ||
if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi | ||
if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi | ||
displayName: Delete Old Simulator Logs | ||
condition: ${{ eq(parameters.platform, 'ios') }} | ||
continueOnError: true | ||
- pwsh: ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --target=uitest --project="${{ parameters.path }}" --appproject="${{ parameters.app }}" --device="${{ parameters.device }}" --apiversion="${{ parameters.version }}" --configuration="${{ parameters.configuration }}" --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} --verbosity=diagnostic | ||
displayName: $(Agent.JobName) | ||
${{ if ne(parameters.platform, 'android')}}: | ||
retryCountOnTaskFailure: 1 | ||
|
||
- bash: | | ||
suffix=$(date +%Y%m%d%H%M%S) | ||
zip -9r "$(LogDirectory)/CoreSimulatorLog_${suffix}.zip" "$HOME/Library/Logs/CoreSimulator/" | ||
zip -9r "$(LogDirectory)/DiagnosticReports_${suffix}.zip" "$HOME/Library/Logs/DiagnosticReports/" | ||
displayName: Zip Simulator Logs | ||
condition: ${{ eq(parameters.platform, 'ios') }} | ||
continueOnError: true | ||
- task: PublishTestResults@2 | ||
displayName: Publish the $(System.PhaseName) test results | ||
condition: always() | ||
inputs: | ||
testResultsFormat: VSTest | ||
testResultsFiles: '$(TestResultsDirectory)/*.trx' | ||
testRunTitle: '$(System.PhaseName)' | ||
failTaskOnFailedTests: true | ||
|
||
- task: PublishBuildArtifacts@1 | ||
condition: always() | ||
displayName: publish artifacts | ||
|
||
# This must always be placed as the last step in the job | ||
- template: agent-rebooter/mac.v1.yml@yaml-templates | ||
parameters: | ||
AgentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.