-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[net10.0] Merge main to net10.0 #31792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bac2432
bb0668b
069238e
a53104a
accdb83
0b8c5c6
7fd337f
762c956
3089870
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| parameters: | ||
| platform: '' # The platform name for logging (e.g., 'Android', 'iOS', 'Windows', 'Mac') | ||
| artifactName: '' # The artifact name to publish (e.g., 'uitest-snapshot-results-android') | ||
|
|
||
| steps: | ||
| - task: PowerShell@2 | ||
| condition: always() | ||
| displayName: Check for ${{ parameters.platform }} snapshot diffs | ||
| name: Check${{ replace(parameters.platform, ' ', '') }}Snapshots # NOTE: This step name must match the variable reference in the condition below | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| $snapshotDiffPath = "$(Build.ArtifactStagingDirectory)/Controls.TestCases.Shared.Tests/snapshots-diff" | ||
| Write-Host "Checking for ${{ parameters.platform }} snapshot diffs at: $snapshotDiffPath" | ||
|
|
||
| if (Test-Path $snapshotDiffPath) { | ||
| $diffFiles = Get-ChildItem $snapshotDiffPath -File -Recurse | ||
|
|
||
| if ($diffFiles.Count -gt 0) { | ||
| Write-Host "✅ Found $($diffFiles.Count) ${{ parameters.platform }} snapshot diff files in snapshots-diff directory" | ||
| Write-Host "##vso[task.setvariable variable=snapshotsExist;isOutput=true]true" | ||
| } else { | ||
| Write-Host "ℹ️ snapshots-diff directory exists but no ${{ parameters.platform }} diff files found" | ||
| Write-Host "##vso[task.setvariable variable=snapshotsExist;isOutput=true]false" | ||
| } | ||
| } else { | ||
| Write-Host "❌ No ${{ parameters.platform }} snapshots-diff directory found at: $snapshotDiffPath" | ||
| Write-Host "##vso[task.setvariable variable=snapshotsExist;isOutput=true]false" | ||
| } | ||
|
|
||
| - task: PublishPipelineArtifact@1 | ||
| condition: eq(variables['Check${{ replace(parameters.platform, ' ', '') }}Snapshots.snapshotsExist'], 'true') # NOTE: This variable reference must match the step name above | ||
|
||
| displayName: Publish ${{ parameters.platform }} snapshot diffs | ||
| inputs: | ||
| targetPath: $(Build.ArtifactStagingDirectory)/Controls.TestCases.Shared.Tests | ||
| artifact: ${{ parameters.artifactName }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step name generation using
replace(parameters.platform, ' ', '')creates potential naming conflicts and maintenance issues. Platform values like 'iOS CV2' and 'iOS CARV2' will generate step names 'CheckiOSCV2Snapshots' and 'CheckiOSCARV2Snapshots' which are not intuitive. Consider using a separate parameter for the step identifier or implementing a more robust naming strategy that handles special characters and ensures uniqueness.