-
Notifications
You must be signed in to change notification settings - Fork 841
WinUI Runtime Tests #22707
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
Merged
+1,874
β1,055
Merged
WinUI Runtime Tests #22707
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
132e7de
feat: Add WinUI runtime tests to CI pipeline
Copilot 7428aca
refactor: Use unpackaged app for WinUI runtime tests
Copilot 5235853
docs: Add documentation for platform-specific test exclusions
Copilot c4bebe7
chore: Remove unused separate runtime tests YAML file
Copilot 54fcf98
fix: Create failed tests directory before test execution
Copilot 28f98f8
docs: Complete list of combined runtime test platforms
Copilot f2dcc1c
fix: Remove trailing space in markdown documentation
Copilot d99cfcd
fix: Correct unpackaged app source folder path for WinAppSDK builds
Copilot 3814a70
ci: Install packaged Samples app
MartinZikmund f58c80b
ci: Use msixbundle
MartinZikmund c3509e6
fix: Use consistent certificate variable name
Copilot 60e7a22
ci: Run WinUI runtime tests on windows-latest
Copilot 75b9a60
fix: Install Windows App Runtime dependencies before MSIX package
Copilot 7b54435
fix: Install Windows App Runtime 1.8 from official source
Copilot 89ff5a7
fix: Improve WinUI command line handling
MartinZikmund 12d88ba
fix: Loading runtime tests control
MartinZikmund 771ebf1
fix: Change command line argument separator from space to '&'
MartinZikmund 5fde0b8
fix: Use `DispatcherQueue` for `RunOnUIThread`
MartinZikmund 22138dc
fix: Avoid propagating exception on UI thread for WinUI
MartinZikmund a58edd5
test: Disable Frame cache mode tests on WinUI
MartinZikmund 78e1958
fix: Avoid `Frame` tests in WinUI
MartinZikmund 0a7091d
chore: Log test progress in debug output
MartinZikmund be09cfc
test: Disable `Given_Frame` on WinUI
MartinZikmund b953afa
fix: Run on UI thread correctly on WinUI
MartinZikmund 4ab208b
fix: Adjust paths for ResourceDictionaries
MartinZikmund 185ef38
test: Disable further fatal crash causing tests for WinUI
MartinZikmund be06830
test: Disable input injection tests on WinUI
MartinZikmund 7cbcc85
chore: Additional logging
MartinZikmund 0d1ba36
chore: Try handling unhandled exception
MartinZikmund 60cff7b
test: Disable WinUI tests that crash Samples App
MartinZikmund 0349b56
test: Disable tests failing on WinUI I.
MartinZikmund 60b8330
test: Disable tests on WinUI II.
MartinZikmund a391978
fix: Close window after test
MartinZikmund d492a55
test: Disable tests failing on WinUI III.
MartinZikmund 51a16c8
test: Disable tests failing on WinUI IV.
MartinZikmund 5a1dd35
test: Disable tests failing on WinUI V.
MartinZikmund 7d7b401
test: Disable test crashing WinUI Samples app
MartinZikmund 5733f80
test: Diable failing WinUI tests VI.
MartinZikmund 61c7ffc
test: Disable test crashing WinUI Samples app
MartinZikmund f77ca3c
test: Disable failing WinUI tests VI.
MartinZikmund 1f323e9
test: Disable failing WinUI tests VII.
MartinZikmund 569ee4e
test: Disable failing WinUI tests VIII.
MartinZikmund 4ffb7f5
test: Disable failing WinUI tests IX.
MartinZikmund 925772e
ci: Ungroup and lower timeout
MartinZikmund b6acec3
test: Disable tests crashing Samples app
MartinZikmund b408784
test: Disable failing WinUI tests
MartinZikmund 239c981
test: Diable MediaPlayerElement tests on WinUI
MartinZikmund 76471a0
test: Disable InteractionTracker tests crashing WinUI tests
MartinZikmund 5fd0367
test: Disable failing WinUI tests
MartinZikmund 1af2da5
test: Disable tests failing on WinUI
MartinZikmund b89a5a1
chore: Remove debug logging in UnitTestsControl
MartinZikmund 5f08b5c
chore: Use `FindName`
MartinZikmund 9754d56
chore: Address comments
MartinZikmund 36953d1
chore: Adjust test
MartinZikmund 939b608
chore: Disable flaky test
MartinZikmund File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,117 @@ | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| function Assert-ExitCodeIsZero() | ||
| { | ||
| if ($LASTEXITCODE -ne 0) | ||
| { | ||
| throw "Exit code must be zero." | ||
| } | ||
| } | ||
|
|
||
| $UNO_TESTS_FAILED_LIST="$env:BUILD_SOURCESDIRECTORY\build\uitests-failure-results\failed-tests-winui-runtimetests.txt" | ||
| $TEST_RESULTS_FILE="$env:BUILD_SOURCESDIRECTORY\build\winui-runtime-tests-results.xml" | ||
|
|
||
| # convert the content of the file UNO_TESTS_FAILED_LIST to base64 and set it to UITEST_RUNTIME_TESTS_FILTER, if the file exists | ||
| if (Test-Path $UNO_TESTS_FAILED_LIST) { | ||
| $base64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Content -Raw $UNO_TESTS_FAILED_LIST))) | ||
| $env:UITEST_RUNTIME_TESTS_FILTER="$base64" | ||
| } | ||
|
|
||
| # Build command-line arguments for runtime tests | ||
| $runtimeTestArgs = @("--runtime-tests=`"$TEST_RESULTS_FILE`"") | ||
|
|
||
| if ($env:UITEST_RUNTIME_TEST_GROUP) { | ||
| $runtimeTestArgs += "--runtime-tests-group=$env:UITEST_RUNTIME_TEST_GROUP" | ||
| } | ||
|
|
||
| if ($env:UITEST_RUNTIME_TEST_GROUP_COUNT) { | ||
| $runtimeTestArgs += "--runtime-tests-group-count=$env:UITEST_RUNTIME_TEST_GROUP_COUNT" | ||
| } | ||
|
|
||
| if ($env:UITEST_RUNTIME_TESTS_FILTER) { | ||
| $runtimeTestArgs += "--runtime-test-filter=$env:UITEST_RUNTIME_TESTS_FILTER" | ||
MartinZikmund marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
MartinZikmund marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
MartinZikmund marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Write-Host "Runtime test arguments: $($runtimeTestArgs -join ' ')" | ||
|
|
||
| # Ensure the failed tests directory exists before running tests | ||
| $failedTestsDir = Split-Path -Parent $UNO_TESTS_FAILED_LIST | ||
| New-Item -ItemType Directory -Force -Path $failedTestsDir | Out-Null | ||
|
|
||
| # Use the app execution alias registered by the MSIX package | ||
| $exeAlias = "unosamplesapp.exe" | ||
|
|
||
| Write-Host "Using app execution alias: $exeAlias" | ||
|
|
||
| # Launch the app with runtime test arguments | ||
| Write-Host "Launching app with runtime tests..." | ||
|
|
||
| $process = Start-Process -FilePath $exeAlias -ArgumentList $runtimeTestArgs -PassThru -NoNewWindow | ||
|
|
||
| Write-Host "App launched with PID: $($process.Id)" | ||
| Write-Host "Waiting for test results..." | ||
|
|
||
| # Wait for the test results file with timeout | ||
| $timeout = 600 # 10 minutes | ||
| $elapsed = 0 | ||
| $checkInterval = 5 | ||
|
|
||
| while ($elapsed -lt $timeout) { | ||
| # Check if process has exited | ||
| if ($process.HasExited) { | ||
| Write-Host "App process has exited with code: $($process.ExitCode)" | ||
| break | ||
| } | ||
|
|
||
| if (Test-Path $TEST_RESULTS_FILE) { | ||
| Write-Host "Test results file found!" | ||
| # Wait a bit more for the app to finish writing and exit cleanly | ||
| Start-Sleep -Seconds 5 | ||
| break | ||
| } | ||
|
|
||
| Start-Sleep -Seconds $checkInterval | ||
| $elapsed += $checkInterval | ||
| Write-Host "Waiting for test results... ($elapsed seconds elapsed)" | ||
| } | ||
|
|
||
| if (-not (Test-Path $TEST_RESULTS_FILE)) { | ||
| Write-Host "Test results file was not created within the timeout period" | ||
|
|
||
| # Try to get the app process logs if still running | ||
| if (-not $process.HasExited) { | ||
| Write-Host "Force stopping the app..." | ||
| Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue | ||
| } | ||
|
|
||
| throw "Test results file was not created" | ||
| } | ||
|
|
||
| # Ensure the process has exited | ||
| if (-not $process.HasExited) { | ||
| Write-Host "Waiting for app to exit gracefully..." | ||
| $process.WaitForExit(30000) # Wait up to 30 seconds | ||
|
|
||
| if (-not $process.HasExited) { | ||
| Write-Host "Force stopping the app..." | ||
| Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue | ||
| } | ||
| } | ||
|
|
||
| Write-Host "Test execution completed. Processing results..." | ||
|
|
||
| ## Export the failed tests list for reuse in a pipeline retry | ||
| Push-Location "$env:BUILD_SOURCESDIRECTORY/src/Uno.NUnitTransformTool" | ||
|
|
||
| Write-Host "Running NUnitTransformTool" | ||
|
|
||
| ## Fail the build when no test results could be read | ||
| dotnet run fail-empty $TEST_RESULTS_FILE | ||
|
|
||
| Assert-ExitCodeIsZero | ||
|
|
||
| dotnet run list-failed $TEST_RESULTS_FILE $UNO_TESTS_FAILED_LIST | ||
|
|
||
MartinZikmund marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Assert-ExitCodeIsZero | ||
|
|
||
| Pop-Location | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.