Conversation
There was a problem hiding this comment.
Pull request overview
Re-enables .NET MAUI template integration tests against DotNetPrevious and extends CI to run the iOS “previous” lane on both ARM64 and x64 macOS pools.
Changes:
- Re-enabled
DotNetPrevious[InlineData]cases inSimpleTemplateTestandWindowsTemplateTest. - Added an iOS test entrypoint (
RunOniOS_Previous) inAppleTemplateTestsfor CI to target. - Added two new CI jobs to run
RunOniOS_Previouson ARM64 and x64 macOS pools.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/WindowsTemplateTest.cs | Re-enables Windows publish tests for DotNetPrevious. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs | Re-enables template build/pack scenarios for DotNetPrevious. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/AppleTemplateTests.cs | Adds RunOniOS_Previous test method for CI targeting. |
| eng/pipelines/ci.yml | Adds new macOS jobs to run iOS previous tests on ARM64 and x64. |
| @@ -62,11 +62,14 @@ public AppleTemplateTests(IntegrationTestFixture fixture, ITestOutputHelper outp | |||
| if (true) return; // Skip: "Running Apple templates is only supported on macOS." | |||
There was a problem hiding this comment.
if (true) return; disables the intended platform guard and does not actually skip tests (it just exits the constructor early). This can cause Apple tests to run on non-macOS environments (or proceed without proper setup) instead of being skipped. Replace this with the standard macOS guard used in the repo (e.g., if (!TestEnvironment.IsMacOS) Assert.Ignore("Running Apple templates is only supported on macOS.");) rather than returning unconditionally.
| // DotNetPrevious test methods | ||
| [Theory] | ||
| [InlineData("maui", "Debug", DotNetPrevious, RuntimeVariant.Mono, null)] | ||
| [InlineData("maui", "Release", DotNetPrevious, RuntimeVariant.Mono, null)] | ||
| [InlineData("maui-blazor", "Debug", DotNetPrevious, RuntimeVariant.Mono, null)] | ||
| [InlineData("maui-blazor", "Release", DotNetPrevious, RuntimeVariant.Mono, null)] | ||
| public void RunOniOS_Previous(string id, string config, string framework, RuntimeVariant runtimeVariant, string? trimMode) | ||
| => RunOniOS(id, config, framework, runtimeVariant, trimMode); | ||
|
|
There was a problem hiding this comment.
The new RunOniOS_Previous is a single [Theory] with multiple [InlineData] cases, but the comment immediately below states the CI model relies on “individual test methods” so each configuration can run in a separate job. With the current structure, the testName: RunOniOS_Previous job will execute all four cases serially in one job per arch. Consider splitting these into separate [Test] methods (or separate theory methods) per configuration (e.g., maui Debug, maui Release, maui-blazor Debug, maui-blazor Release) so the code matches the comment/CI strategy and keeps job runtimes predictable.
| // DotNetPrevious test methods | |
| [Theory] | |
| [InlineData("maui", "Debug", DotNetPrevious, RuntimeVariant.Mono, null)] | |
| [InlineData("maui", "Release", DotNetPrevious, RuntimeVariant.Mono, null)] | |
| [InlineData("maui-blazor", "Debug", DotNetPrevious, RuntimeVariant.Mono, null)] | |
| [InlineData("maui-blazor", "Release", DotNetPrevious, RuntimeVariant.Mono, null)] | |
| public void RunOniOS_Previous(string id, string config, string framework, RuntimeVariant runtimeVariant, string? trimMode) | |
| => RunOniOS(id, config, framework, runtimeVariant, trimMode); | |
| // DotNetPrevious test methods (individual methods per configuration for CI filtering) | |
| [Fact] | |
| public void RunOniOS_Previous_MauiDebug() => RunOniOS("maui", "Debug", DotNetPrevious, RuntimeVariant.Mono, null); | |
| [Fact] | |
| public void RunOniOS_Previous_MauiRelease() => RunOniOS("maui", "Release", DotNetPrevious, RuntimeVariant.Mono, null); | |
| [Fact] | |
| public void RunOniOS_Previous_BlazorDebug() => RunOniOS("maui-blazor", "Debug", DotNetPrevious, RuntimeVariant.Mono, null); | |
| [Fact] | |
| public void RunOniOS_Previous_BlazorRelease() => RunOniOS("maui-blazor", "Release", DotNetPrevious, RuntimeVariant.Mono, null); |
| - name: mac_runios_previous_arm64 | ||
| ${{ if eq(variables['Build.DefinitionName'], 'maui-pr') }}: | ||
| pool: ${{ parameters.MacOSPool.public }} | ||
| ${{ else }}: |
There was a problem hiding this comment.
There are trailing spaces after ${{ else }}:. This is minor, but it can trip YAML linting or style checks. Consider removing the extra whitespace.
| - name: mac_runios_previous | ||
| ${{ if eq(variables['Build.DefinitionName'], 'maui-pr') }}: | ||
| pool: ${{ parameters.MacOSPool.public }} | ||
| ${{ else }}: |
There was a problem hiding this comment.
There are trailing spaces after ${{ else }}:. This is minor, but it can trip YAML linting or style checks. Consider removing the extra whitespace.
|
/rebase |
16207aa to
e8e499b
Compare
🟡 .NET MAUI Code Review — Changes Suggested
🟡 Review Session — Changes Suggested —
|
|
|
Description of Change
This pull request re-enables and adds several integration tests for .NET MAUI templates targeting the "DotNetPrevious" framework across iOS, macOS, and Windows, and updates the CI pipeline to run these tests in parallel for both ARM64 and x64 architectures. These changes help ensure better test coverage for previous .NET versions and improve CI reliability.
Test Coverage Improvements:
[InlineData]test cases for "DotNetPrevious" inSimpleTemplateTest.cs, coveringmaui,maui-blazor, andmauilibtemplates for build, special character, and bad image file scenarios. [1] [2] [3][InlineData]test cases for "DotNetPrevious" inWindowsTemplateTest.cs, covering both packaged and unpackaged publish scenarios formauiandmaui-blazortemplates. [1] [2]AppleTemplateTests.csfor running iOS tests on the "DotNetPrevious" framework, enabling parallel execution in CI.CI Pipeline Enhancements:
ci.ymlpipeline to run iOS template tests for "DotNetPrevious" on both ARM64 (mac_runios_previous_arm64) and x64 (mac_runios_previous) architectures, supporting both public and internal MacOS pools and improving CI coverage for previous .NET versions. [1] [2]