Skip to content

Comments

Add integration tests for third-party toolkit compatibility#34051

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-integration-test-regression
Draft

Add integration tests for third-party toolkit compatibility#34051
Copilot wants to merge 3 commits intomainfrom
copilot/add-integration-test-regression

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

MAUI changes can break compatibility with popular ecosystem packages without being caught by existing tests. This adds integration tests that validate builds with commonly-used third-party toolkits.

Changes

New file: src/TestUtils/src/Microsoft.Maui.IntegrationTests/ToolkitTests.cs

Three test scenarios (6 test cases: Debug + Release each):

  • BuildWithCommunityToolkit - Validates CommunityToolkit.Maui integration
  • BuildWithSyncfusionToolkit - Validates Syncfusion.Maui.Toolkit integration
  • BuildWithMultipleToolkits - Validates both toolkits simultaneously (catches conflicts)

Pattern

Each test:

  1. Creates MAUI app from template
  2. Injects package references into .csproj
  3. Updates MauiProgram.cs with toolkit initialization
  4. Builds with TreatWarningsAsErrors=true

Package versions sourced from eng/Versions.props to stay current with tracked versions.

Example

[Theory]
[InlineData("maui", DotNetCurrent, "Debug")]
[InlineData("maui", DotNetCurrent, "Release")]
public void BuildWithCommunityToolkit(string id, string framework, string config)
{
    // Create template project
    DotnetInternal.New(id, projectDir, framework);
    
    // Add toolkit package
    var version = GetPackageVersion("CommunityToolkitMauiPackageVersion");
    FileUtilities.ReplaceInFile(projectFile, "</Project>",
        $"<ItemGroup><PackageReference Include=\"CommunityToolkit.Maui\" Version=\"{version}\" /></ItemGroup></Project>");
    
    // Update MauiProgram.cs
    FileUtilities.ReplaceInFile(mauiProgramFile, 
        ".UseMauiApp<App>()", 
        ".UseMauiApp<App>().UseMauiCommunityToolkit()");
    
    // Build and verify
    DotnetInternal.Build(projectFile, config, properties: BuildProps, msbuildWarningsAsErrors: true);
}

Part of "Build" test category, runs in standard integration test pipeline.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh pr view 34047 --json title,body,files (http block)
  • https://api.github.com/repos/dotnet/maui/pulls/34047
    • Triggering command: /usr/bin/curl curl -s REDACTED git conf�� Fusion s/AppleTemplateTests.cs de/node/bin/grep red/Core.DeviceTgrep .Benchmarks.cspr-l d/Benchmarks.Drotoolkit\|34047 e.DeviceTests.cs./.github/skills/run-helix-tests/SKILL.md Unit�� amples/Controls.Sample/Pages/Controls/RadioButtonGalleries/RadioButtonContentGallery.xaml.cs .IntegrationTests/SampleTests.cs inks/src/Compatibility.Android.AppLinks.csproj ndroid/Compatibigrep ompatibility.Uni-l inUI/Compatibilitoolkit\|34047 OS/Compatibility./.github/skills/write-xaml-tests/SKILL.md (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 14, 2026 00:13
Created ToolkitTests.cs with three test cases:
1. BuildWithCommunityToolkit - Tests MAUI compatibility with CommunityToolkit.Maui
2. BuildWithSyncfusionToolkit - Tests MAUI compatibility with Syncfusion.Maui.Toolkit
3. BuildWithMultipleToolkits - Tests MAUI with both toolkits simultaneously

These tests help catch regressions where MAUI changes break compatibility with popular third-party packages.

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Added comprehensive documentation explaining:
- Purpose: Catch regressions breaking third-party package compatibility
- Pattern: Similar to SampleTests.cs
- Context: Reference to PR #34047
- Ecosystem impact: Ensures MAUI build system remains compatible with community packages

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] Add integration test similar to SyncFusion toolkit tests Add integration tests for third-party toolkit compatibility Feb 14, 2026
Copilot AI requested a review from PureWeen February 14, 2026 00:17
Comment on lines +3 to +14
/// <summary>
/// Integration tests that verify .NET MAUI builds successfully with popular third-party toolkit packages.
///
/// These tests help catch regressions where MAUI changes break compatibility with widely-used community packages
/// such as CommunityToolkit.Maui and Syncfusion.Maui.Toolkit. By building template projects with these packages,
/// we ensure that MAUI's build system, MSBuild tasks, and SDK remain compatible with the broader MAUI ecosystem.
///
/// Tests follow the same pattern as SampleTests.cs - creating projects from templates, adding package references,
/// and building to ensure no breaking changes have been introduced.
///
/// See also: https://github.com/dotnet/maui/pull/34047
/// </summary>
Copy link
Contributor

@dartasen dartasen Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think building a project with the package will help avoid the breaking change with InternalVisibleTo. Since the toolkit version will likely target an older version of MAUI than the CI one, it will always build but will cause runtime errors only.

Would creating a sample with several toolkit controls help in some way ?
Just to ensure that the app can build and at least display the first page with various controls without crashing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants