run-integration-tests

0
0
Source

Build, pack, and run .NET MAUI integration tests locally. Validates templates, samples, and end-to-end scenarios using the local workload.

Install

mkdir -p .claude/skills/run-integration-tests && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4418" && unzip -o skill.zip -d .claude/skills/run-integration-tests && rm skill.zip

Installs to .claude/skills/run-integration-tests

About this skill

Run Integration Tests Skill

Build the MAUI product, install local workloads, and run integration tests.

When to Use

  • User asks to "run integration tests"
  • User asks to "test templates locally"
  • User asks to "validate MAUI build with templates"
  • User wants to verify changes don't break template scenarios
  • User asks to run specific test categories (WindowsTemplates, Samples, Build, Blazor, etc.)

Available Test Categories

CategoryPlatformDescription
BuildAllBasic template build tests
WindowsTemplatesWindowsWindows-specific template scenarios
macOSTemplatesmacOSmacOS-specific scenarios
BlazorAllBlazor hybrid templates
MultiProjectAllMulti-project templates
SamplesAllSample project builds
AOTmacOSNative AOT compilation
RunOnAndroidmacOSBuild, install, run on Android emulator
RunOniOSmacOSiOS simulator tests

Scripts

All scripts are in .github/skills/run-integration-tests/scripts/

Run Integration Tests (Full Workflow)

# 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

Parameters

ParameterRequiredDefaultDescription
-CategoryNo-Test category to run (WindowsTemplates, Samples, Build, etc.)
-TestFilterNo-Custom NUnit test filter expression
-ConfigurationNoDebugBuild configuration (Debug/Release)
-SkipBuildNofalseSkip build/pack step if already done
-SkipInstallNofalseSkip workload installation if already done
-SkipXcodeVersionCheckNofalseSkip Xcode version validation (macOS)
-AutoProvisionNofalseAutomatically provision local SDK if not found
-ResultsDirectoryNoartifacts/integration-testsDirectory for test results

Workflow Steps

The script performs these steps:

  1. Build & Pack: .\build.cmd -restore -pack -configuration $Configuration
  2. Install Workloads: .dotnet\dotnet build .\src\DotNet\DotNet.csproj -t:Install -c $Configuration
  3. Extract Version: Reads MAUI_PACKAGE_VERSION from installed packs
  4. Run Tests: .dotnet\dotnet test ... -filter "Category=$Category"

Example Usage

# 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"

Prerequisites

  • Windows for WindowsTemplates, macOS for macOSTemplates/RunOniOS/RunOnAndroid
  • .NET SDK (version from global.json)
  • Sufficient disk space for build artifacts
  • Local SDK and workloads must be provisioned first

Provisioning the Local SDK (Required First Time)

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=dotnet syntax no longer works. Use dotnet cake directly.

Output

  • Test results in TRX format at <ResultsDirectory>/
  • Build logs in artifacts/ directory
  • Console output with test pass/fail summary

Troubleshooting

IssueSolution
"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 foundWorkload installation may have failed
Build failuresCheck 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 invalidIntegration tests are long-running (15-60+ min). Run manually in a terminal window instead of via Copilot CLI
Tests take too longStart 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

Running Manually (Recommended for Long-Running Tests)

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"

Running All Categories Sequentially

# 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 Individual iOS Tests (Recommended)

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
}

More by dotnet

View all →

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

284790

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

212415

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

205286

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

216234

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

169197

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

165173

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.