mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
### Summary This pull request includes the following updates: 1. Improvements and stabilization of the UI automation framework 2. Setup of the UI automation pipeline 3. Add UI test cases for FancyZones 4. Add UI test cases for MouseUtils 5. Improvements of Hosts Editor UI tests --- ### Related Links - **Current Release checklist coverage**: https://github.com/microsoft/PowerToys/blob/feature/UITestAutomation/src/common/UITestAutomation/Doc/ui-automation-cover-list.md - **UI Automation pipeline**: https://microsoft.visualstudio.com/Dart/_build?definitionId=161438&_a=summary --------- Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com> Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com> Co-authored-by: Jerry Xu <n.xu@outlook.com> Co-authored-by: Zhaopeng Wang <zhaopengwang@microsoft.com> Co-authored-by: Xiaofeng Wang (from Dev Box) <xiaofengwang@microsoft.com> Co-authored-by: Mengyuan <162882040+chenmy77@users.noreply.github.com> Co-authored-by: yaqingmi <miyaqing01@gmail.com> Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Yaqing Mi (from Dev Box) <yaqingmi@microsoft.com> Co-authored-by: Kai Tao <69313318+vanzue@users.noreply.github.com> Co-authored-by: zhaopeng wang <33367956+wang563681252@users.noreply.github.com> Co-authored-by: Laszlo Nemeth <57342539+donlaci@users.noreply.github.com> Co-authored-by: RokyZevon <12629919+RokyZevon@users.noreply.github.com> Co-authored-by: Yu Leng <42196638+moooyo@users.noreply.github.com> Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com> Co-authored-by: Davide Giacometti <25966642+davidegiacometti@users.noreply.github.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com> Co-authored-by: ruslanlap <106077551+ruslanlap@users.noreply.github.com> Co-authored-by: Muhammad Danish <mdanishkhdev@gmail.com> Co-authored-by: Bennett Blodinger <benwa@users.noreply.github.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com> Co-authored-by: Ionuț Manța <ionut@janeasystems.com> Co-authored-by: Hao Liu <liuhaobupt@163.com> Co-authored-by: OlegHarchevkin <40352094+OlegKharchevkin@users.noreply.github.com> Co-authored-by: dcog989 <89043002+dcog989@users.noreply.github.com> Co-authored-by: PesBandi <127593627+PesBandi@users.noreply.github.com> Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Co-authored-by: vanzue <vanzue@outlook.com> Co-authored-by: Typpi <20943337+Nick2bad4u@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Abhyudit <64366765+bitmap4@users.noreply.github.com> Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Ved Nig <vednig12@outlook.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Aung Khaing Khant <aungkhaingkhant.dev@gmail.com> Co-authored-by: Aung Khaing Khant <aungkhaingkhant@advent-soft.com> Co-authored-by: Dustin L. Howett <duhowett@microsoft.com> Co-authored-by: leileizhang <leilzh@microsoft.com> Co-authored-by: Dustin L. Howett <dustin@howett.net> Co-authored-by: Shawn Yuan <128874481+shuaiyuanxx@users.noreply.github.com> Co-authored-by: Shawn Yuan <shuai.yuan.zju@gmail.com> Co-authored-by: cryolithic <cryolithic@gmail.com> Co-authored-by: Lemonyte <49930425+lemonyte@users.noreply.github.com> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Corey Hayward <72159232+CoreyHayward@users.noreply.github.com> Co-authored-by: Jerry Xu <nxu@microsoft.com> Co-authored-by: Shawn Yuan <shuaiyuan@microsoft.com> Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Jeremy Sinclair <4016293+snickler@users.noreply.github.com>
95 lines
4.7 KiB
PowerShell
95 lines
4.7 KiB
PowerShell
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory = $True, Position = 1)]
|
|
[string]$targetDir
|
|
)
|
|
|
|
# This script will check every deps.json file in the target directory to see if for each dll mentioned,
|
|
#all the deps.json files that mention it will mention the same version.
|
|
# The main goal is to catch when different versions for the same module might be copied to the same directory
|
|
#at build time and might create flaky builds that get the wrong version of the dll sometimes.
|
|
|
|
# A dictionary of dictionaries of lists to save which files reference each version of each dll.
|
|
# Logic is DllName > fileVersion > list with deps.json files that reference it.
|
|
# If for a specific dll there's more than one referenced file version, we have build collisions.
|
|
$referencedFileVersionsPerDll = @{}
|
|
$totalFailures = 0
|
|
|
|
Get-ChildItem $targetDir -Recurse -Filter *.deps.json -Exclude *UITest*,MouseJump.Common.UnitTests*,*.FuzzTests* | ForEach-Object {
|
|
# Temporarily exclude All UI-Test, Fuzzer-Test projects because of Appium.WebDriver dependencies
|
|
$depsJsonFullFileName = $_.FullName
|
|
|
|
if ($depsJsonFullFileName -like "*CmdPal*") {
|
|
return
|
|
}
|
|
|
|
$depsJsonFileName = $_.Name
|
|
$depsJson = Get-Content $depsJsonFullFileName | ConvertFrom-Json
|
|
|
|
# We're doing a breadth first search to look for every runtime object.
|
|
$iterateThroughEveryField = New-Object System.Collections.Generic.Queue[System.Object]
|
|
$iterateThroughEveryField.Enqueue($depsJson)
|
|
|
|
while($iterateThroughEveryField.Count -gt 0)
|
|
{
|
|
$currentObject = $iterateThroughEveryField.Dequeue();
|
|
$currentObject.PSObject.Properties | ForEach-Object {
|
|
if($_.Name -ne 'SyncRoot') {
|
|
# Skip SyncRoot to avoid looping in array objects.
|
|
# Care only about objects, not value types.
|
|
$iterateThroughEveryField.Enqueue($_.Value)
|
|
if($_.Name -eq 'runtime')
|
|
{
|
|
# Cycle through each dll.
|
|
$_.Value.PSObject.Properties | ForEach-Object {
|
|
if($_.Name.EndsWith('.dll')) {
|
|
$dllName = Split-Path $_.Name -leaf
|
|
if([bool]($_.Value.PSObject.Properties.name -match 'fileVersion')) {
|
|
$dllFileVersion = $_.Value.fileVersion
|
|
if (([string]::IsNullOrEmpty($dllFileVersion) -or ($dllFileVersion -eq '0.0.0.0')) -and $dllName.StartsWith('PowerToys.'))` {
|
|
# After VS 17.11 update some of PowerToys dlls have no fileVersion in deps.json even though the
|
|
# version is correctly set. This is a workaround to skip our dlls as we are confident that all of
|
|
# our dlls share the same version across the dependencies.
|
|
# After VS 17.13 these error versions started appearing as 0.0.0.0 so we've added that case to the condition as well.
|
|
continue
|
|
}
|
|
|
|
# Add the entry to the dictionary of dictionary of lists
|
|
if(-Not $referencedFileVersionsPerDll.ContainsKey($dllName)) {
|
|
$referencedFileVersionsPerDll[$dllName] = @{ $dllFileVersion = New-Object System.Collections.Generic.List[System.String] }
|
|
} elseif(-Not $referencedFileVersionsPerDll[$dllName].ContainsKey($dllFileVersion)) {
|
|
$referencedFileVersionsPerDll[$dllName][$dllFileVersion] = New-Object System.Collections.Generic.List[System.String]
|
|
}
|
|
$referencedFileVersionsPerDll[$dllName][$dllFileVersion].Add($depsJsonFileName)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
# Report on the files that are referenced for more than one version.
|
|
$referencedFileVersionsPerDll.keys | ForEach-Object {
|
|
if($referencedFileVersionsPerDll[$_].Count -gt 1) {
|
|
$dllName = $_
|
|
Write-Host $dllName
|
|
$referencedFileVersionsPerDll[$dllName].keys | ForEach-Object {
|
|
Write-Host "`t" $_
|
|
$referencedFileVersionsPerDll[$dllName][$_] | ForEach-Object {
|
|
Write-Host "`t`t" $_
|
|
}
|
|
}
|
|
$totalFailures++;
|
|
}
|
|
}
|
|
|
|
if ($totalFailures -gt 0) {
|
|
Write-Host -ForegroundColor Red "Detected " $totalFailures " libraries that are mentioned with different version across the dependencies.`r`n"
|
|
exit 1
|
|
}
|
|
|
|
Write-Host -ForegroundColor Green "All " $referencedFileVersionsPerDll.keys.Count " libraries are mentioned with the same version across the dependencies.`r`n"
|
|
exit 0
|