61 строка
2.2 KiB
YAML
61 строка
2.2 KiB
YAML
parameters:
|
|
vmImage: ''
|
|
|
|
jobs:
|
|
|
|
- job: UITests_Screenshots_Compare
|
|
displayName: 'UI Tests Screenshots Comparison'
|
|
|
|
timeoutInMinutes: 90
|
|
cancelTimeoutInMinutes: 1
|
|
|
|
condition: or(succeeded(), and(failed(), ge(variables['System.StageAttempt'], 5)))
|
|
|
|
pool: ${{ parameters.poolName }}
|
|
|
|
|
|
variables:
|
|
COMPARE_WORKDIR: $(Build.SourcesDirectory)\snapshot-compare
|
|
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
|
|
- template: templates/dotnet-install.yml
|
|
|
|
- powershell: |
|
|
dotnet build -c Release src/Uno.UI.TestComparer/Uno.UI.TestComparer.csproj /bl:$(build.artifactstagingdirectory)/test-comparer.binlog
|
|
displayName: Build Test Comparer
|
|
|
|
- script: |
|
|
src\Uno.UI.TestComparer\bin\Release\Uno.UI.TestComparer.exe "azdo" --pat="$(UITestsCompare_PAT)" --base-path="$(COMPARE_WORKDIR)" --source-branch="%GIT_SOURCEBRANCH%" --target-branch="%GIT_TARGETBRANCH%" --artifact-name="uitests-results" --artifact-inner-path="uitests-results\screenshots" --definition-name="$(Build.DefinitionName)" --project-name="$(System.TeamProject)" --server-uri="$(System.TeamFoundationCollectionUri)" --current-build="$(Build.BuildId)" --run-limit="2" --github-pat="$(CommentsGitHubPAT)" --source-repository="$(system.pullRequest.sourceRepositoryUri)" --github-pr-id="$(system.pullRequest.pullRequestNumber)"
|
|
|
|
env:
|
|
GIT_TARGETBRANCH: "$(System.PullRequest.TargetBranch)"
|
|
GIT_SOURCEBRANCH: "$(Build.SourceBranch)"
|
|
|
|
displayName: 'Compare UI Tests screenshots'
|
|
condition: eq(variables['Build.Repository.Provider'], 'GitHub')
|
|
|
|
- task: PublishTestResults@2
|
|
condition: always()
|
|
inputs:
|
|
testResultsFiles: '$(COMPARE_WORKDIR)\*.xml'
|
|
testRunTitle: 'Screenshots Compare Test Run'
|
|
testResultsFormat: 'NUnit'
|
|
failTaskOnFailedTests: false
|
|
|
|
- task: ArchiveFiles@2
|
|
inputs:
|
|
rootFolderOrFile: '$(COMPARE_WORKDIR)'
|
|
includeRootFolder: true
|
|
archiveType: 'zip'
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/snapshot-compare-results-$(Build.BuildId).zip'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
retryCountOnTaskFailure: 3
|
|
inputs:
|
|
PathtoPublish: $(build.artifactstagingdirectory)
|
|
ArtifactName: uitests-compare-results
|
|
ArtifactType: Container
|