一键导入
run-integration-tests
Build, pack, and run .NET MAUI integration tests locally. Validates templates, samples, and end-to-end scenarios using the local workload.
菜单
Build, pack, and run .NET MAUI integration tests locally. Validates templates, samples, and end-to-end scenarios using the local workload.
基于 SOC 职业分类
Assesses ship-readiness for .NET MAUI release branches — Servicing Releases (SR) and Previews. Surveys CI pipelines, computes what's actually NEW in the branch (commits + source PRs with revert detection), and cross-references open `regressed-in-*` issues against branch contents to identify port candidates, rejected backports, and unresolved regressions. Supports both in-flight and pre-cut (candidate) modes for SR and Preview branches.
Labels issues and pull requests in the dotnet/maui repository with `area-*` and `platform/*` labels ONLY, based on technical content and platform-file conventions. Used by the gh-aw agentic-labeler workflow and available for batch evaluation and interactive Copilot CLI usage.
Deep code review of PR changes for correctness, safety, and MAUI conventions. Uses independence-first assessment (code before narrative) and delegates to the maui-expert-reviewer agent for per-dimension sub-agent evaluation. Triggers on: "review code for PR", "code review PR", "analyze code changes", "check PR code quality". Do NOT use for: summarizing PRs, describing what changed, general PR questions, running tests, or fixing code.
Evaluates tests added in a PR for coverage, quality, edge cases, and test type appropriateness. Checks if tests cover the fix, finds gaps, and recommends lighter test types when possible. Prefer unit tests over device tests over UI tests. Triggers on: 'evaluate tests in PR', 'review test quality', 'are these tests good enough', 'check test coverage', 'is this test adequate', 'assess test coverage for PR'.
Attempts ONE alternative fix for a bug, tests it empirically, and reports results. ALWAYS explores a DIFFERENT approach from existing PR fixes. Use when CI or an agent needs to try independent fix alternatives. Invoke with problem description, test command, target files, and optional hints.
Verifies tests catch the bug. Auto-detects test type (UI tests, device tests, unit tests) and dispatches to the appropriate runner. Supports two modes - verify failure only (test creation) or full verification (test + fix validation).
| name | run-integration-tests |
| description | Build, pack, and run .NET MAUI integration tests locally. Validates templates, samples, and end-to-end scenarios using the local workload. |
| metadata | {"author":"dotnet-maui","version":"1.0"} |
| compatibility | Requires Windows for WindowsTemplates category. macOS for macOSTemplates, RunOniOS, RunOnAndroid. |
Build the MAUI product, install local workloads, and run integration tests.
| Category | Platform | Description |
|---|---|---|
Build | All | Basic template build tests |
WindowsTemplates | Windows | Windows-specific template scenarios |
macOSTemplates | macOS | macOS-specific scenarios |
Blazor | All | Blazor hybrid templates |
MultiProject | All | Multi-project templates |
Samples | All | Sample project builds |
AOT | macOS | Native AOT compilation |
RunOnAndroid | macOS | Build, install, run on Android emulator |
RunOniOS | macOS | iOS simulator tests |
All scripts are in .github/skills/run-integration-tests/scripts/
# Run with specific category
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "WindowsTemplates"
# Run with Release configuration
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "Samples" -Configuration "Release"
# Run with custom test filter
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~BuildSample"
# Skip build step (if already built)
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "Build" -SkipBuild
# macOS: Skip Xcode version check (for version mismatches)
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "macOSTemplates" -SkipBuild -SkipInstall -SkipXcodeVersionCheck
# Auto-provision SDK if not found (first-time setup)
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "Build" -AutoProvision
| Parameter | Required | Default | Description |
|---|---|---|---|
-Category | No | - | Test category to run (WindowsTemplates, Samples, Build, etc.) |
-TestFilter | No | - | Custom NUnit test filter expression |
-Configuration | No | Debug | Build configuration (Debug/Release) |
-SkipBuild | No | false | Skip build/pack step if already done |
-SkipInstall | No | false | Skip workload installation if already done |
-SkipXcodeVersionCheck | No | false | Skip Xcode version validation (macOS) |
-AutoProvision | No | false | Automatically provision local SDK if not found |
-ResultsDirectory | No | artifacts/integration-tests | Directory for test results |
The script performs these steps:
.\build.cmd -restore -pack -configuration $Configuration.dotnet\dotnet build .\src\DotNet\DotNet.csproj -t:Install -c $Configuration.dotnet\dotnet test ... -filter "Category=$Category"# Run WindowsTemplates tests
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "WindowsTemplates"
# Run Samples tests
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "Samples"
# Run multiple categories
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "Category=Build|Category=Blazor"
Before running integration tests, you must provision the local .NET SDK and MAUI workloads:
# Step 1: Restore dotnet tools
dotnet tool restore
# Step 2: Provision local SDK and install workloads (~5 minutes)
dotnet cake --target=dotnet
# Step 3: Install MAUI local workloads
dotnet cake --target=dotnet-local-workloads
Verification:
# Check SDK exists
ls .dotnet/dotnet
# Check MAUI SDK version
ls .dotnet/packs/Microsoft.Maui.Sdk
Note: The old
./build.sh --target=dotnetsyntax no longer works. Usedotnet cakedirectly.
<ResultsDirectory>/artifacts/ directory| Issue | Solution |
|---|---|
| "MAUI_PACKAGE_VERSION was not set" | Ensure build step completed successfully |
| "Local .dotnet SDK not found" | Run dotnet tool restore && dotnet cake --target=dotnet && dotnet cake --target=dotnet-local-workloads |
| Template not found | Workload installation may have failed |
| Build failures | Check artifacts/log/ for detailed build logs |
| "Cannot proceed with locked .dotnet folder" | Kill processes using .dotnet: Get-Process | Where-Object { $_.Path -like "*\.dotnet\*" } | ForEach-Object { Stop-Process -Id $_.Id -Force } |
| Session times out / becomes invalid | Integration tests are long-running (15-60+ min). Run manually in a terminal window instead of via Copilot CLI |
| Tests take too long | Start with Build category (fastest), then run others. Use -SkipBuild -SkipInstall if workloads are already installed |
| iOS tests fail with "mlaunch exited with 1" | Simulator state issue. Run individual tests instead of the whole category (see below) |
| iOS simulator state errors (code 137/149) | Reset simulator: xcrun simctl shutdown all && xcrun simctl erase all or run tests individually |
Integration tests can take 15-60+ minutes depending on the category. For best results, run directly in a terminal:
cd D:\repos\dotnet\maui
# Option 1: Use the skill script
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category "Build" -SkipBuild -SkipInstall
# Option 2: Run dotnet test directly (if workloads already installed)
$env:MAUI_PACKAGE_VERSION = (Get-ChildItem .dotnet\packs\Microsoft.Maui.Sdk -Directory | Sort-Object Name -Descending | Select-Object -First 1).Name
.dotnet\dotnet test src\TestUtils\src\Microsoft.Maui.IntegrationTests --filter "Category=Build"
# Windows categories (run on Windows)
$categories = @("Build", "WindowsTemplates", "Blazor", "MultiProject", "Samples")
foreach ($cat in $categories) {
Write-Host "Running $cat..." -ForegroundColor Cyan
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -Category $cat -SkipBuild -SkipInstall
}
Running all iOS tests together (-Category "RunOniOS") can cause simulator state issues. For better reliability, run tests individually:
# Available iOS tests
$iosTests = @(
"RunOniOS_MauiDebug",
"RunOniOS_MauiRelease",
"RunOniOS_MauiReleaseTrimFull",
"RunOniOS_BlazorDebug",
"RunOniOS_BlazorRelease",
"RunOniOS_MauiNativeAOT"
)
# Run a specific iOS test
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~RunOniOS_MauiDebug" -SkipBuild -SkipInstall -SkipXcodeVersionCheck
# Run all iOS tests individually (more reliable than running category)
foreach ($test in $iosTests) {
Write-Host "Running $test..." -ForegroundColor Cyan
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~$test" -SkipBuild -SkipInstall -SkipXcodeVersionCheck
}