From 9ed5b6d1bc0652da41b1f2da7f7d12273f1f9b0f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 25 Feb 2026 20:37:23 +0100 Subject: [PATCH 1/4] Skip macOS test results when stages are not run When macOS/MacCatalyst platforms are disabled, the macOS test stages are skipped (RUN_MAC_TESTS=false). Previously, the test result aggregation would still include these entries and report them as failures since no results were found. Now, when a mac test has no corresponding stage dependency results (indicating the stage was skipped), it is excluded from the comment entirely instead of being reported as a failure. --- .../scripts/TestConfiguration.Tests.ps1 | 71 +++++++++++++++++++ .../automation/scripts/TestConfiguration.psm1 | 9 +++ 2 files changed, 80 insertions(+) diff --git a/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 b/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 index 574f3c5b9ec2..092cc23a6c6a 100644 --- a/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 +++ b/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 @@ -335,4 +335,75 @@ Describe 'Get-TestConfiguration' { "@ } + Context 'macOS tests excluded when platforms disabled' { + It "excludes mac tests when neither macOS nor MacCatalyst is enabled" { + $macTestConfigs = @" +[ + { + "label": "cecil", + "splitByPlatforms": "false", + "testPrefix": "simulator_tests" + }, + { + "label": "mac_monterey", + "displayName": "Tests on macOS Monterey (12)", + "splitByPlatforms": "false", + "testPrefix": "mac_12_m1", + "testStage": "mac_12_m1", + "isMacTest": true + } +] +"@ + $supportedPlatforms = @" +[ + { "platform": "iOS" }, + { "platform": "tvOS" } +] +"@ + # Only tvOS enabled — no macOS or MacCatalyst + $result = Get-TestConfiguration ` + -TestConfigurations $macTestConfigs ` + -SupportedPlatforms $supportedPlatforms ` + -EnabledPlatforms "tvOS" ` + -TestsLabels "test-labels" ` + -StatusContext "ctx" ` + -StageFilter "" + + $parsed = $result | ConvertFrom-Json + # cecil should be present, mac_monterey should not + $parsed.cecil | Should -Not -BeNullOrEmpty + $parsed.PSObject.Properties.Name | Should -Not -Contain "mac_monterey" + } + + It "includes mac tests when macOS is enabled" { + $macTestConfigs = @" +[ + { + "label": "mac_monterey", + "displayName": "Tests on macOS Monterey (12)", + "splitByPlatforms": "false", + "testPrefix": "mac_12_m1", + "testStage": "mac_12_m1", + "isMacTest": true + } +] +"@ + $supportedPlatforms = @" +[ + { "platform": "macOS" } +] +"@ + $result = Get-TestConfiguration ` + -TestConfigurations $macTestConfigs ` + -SupportedPlatforms $supportedPlatforms ` + -EnabledPlatforms "macOS" ` + -TestsLabels "test-labels" ` + -StatusContext "ctx" ` + -StageFilter "" + + $parsed = $result | ConvertFrom-Json + $parsed.mac_monterey | Should -Not -BeNullOrEmpty + } + } + } diff --git a/tools/devops/automation/scripts/TestConfiguration.psm1 b/tools/devops/automation/scripts/TestConfiguration.psm1 index 148db8f7e1eb..55d91a2f93e6 100644 --- a/tools/devops/automation/scripts/TestConfiguration.psm1 +++ b/tools/devops/automation/scripts/TestConfiguration.psm1 @@ -42,6 +42,15 @@ class TestConfiguration { Write-Host "Test $label with testStage '$testStage' is included, because there's no stage filter set" } + # Skip macOS tests if neither macOS nor MacCatalyst platforms are enabled + if ($config.isMacTest -eq "true" -or $config.isMacTest -eq $true) { + $hasMacPlatform = ($this.enabledPlatforms -contains "macOS") -or ($this.enabledPlatforms -contains "MacCatalyst") + if (-not $hasMacPlatform) { + Write-Host "Skipping mac test $label - neither macOS nor MacCatalyst platforms are enabled" + continue + } + } + $vars = [ordered]@{} # set common variables $vars["LABEL"] = $label From 6ce49db04da157223bc7985f52f612a71b45598f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 26 Feb 2026 09:47:51 +0100 Subject: [PATCH 2/4] Temporarily disable macOS + Mac Catalyst to verify changes. --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index ee35a9a02d36..3c37c6d2b96f 100644 --- a/Make.config +++ b/Make.config @@ -277,9 +277,9 @@ MIN_TVOS_SIMULATOR_VERSION=16.0 EXTRA_SIMULATORS=iOS:MIN_IOS_SIMULATOR_VERSION tvOS:MIN_TVOS_SIMULATOR_VERSION INCLUDE_IOS=1 -INCLUDE_MAC=1 +INCLUDE_MAC= INCLUDE_TVOS=1 -INCLUDE_MACCATALYST=1 +INCLUDE_MACCATALYST= INCLUDE_SIMULATOR=1 INCLUDE_DEVICE=1 From 60edaace26adf892f5c0649e05ef6d05ae9f6d45 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 26 Feb 2026 17:04:01 +0100 Subject: [PATCH 3/4] Revert "Temporarily disable macOS + Mac Catalyst to verify changes." This reverts commit 6ce49db04da157223bc7985f52f612a71b45598f. --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index 3c37c6d2b96f..ee35a9a02d36 100644 --- a/Make.config +++ b/Make.config @@ -277,9 +277,9 @@ MIN_TVOS_SIMULATOR_VERSION=16.0 EXTRA_SIMULATORS=iOS:MIN_IOS_SIMULATOR_VERSION tvOS:MIN_TVOS_SIMULATOR_VERSION INCLUDE_IOS=1 -INCLUDE_MAC= +INCLUDE_MAC=1 INCLUDE_TVOS=1 -INCLUDE_MACCATALYST= +INCLUDE_MACCATALYST=1 INCLUDE_SIMULATOR=1 INCLUDE_DEVICE=1 From 95c853ebc203a5e5b30351e7f42da2ba0e50b8d0 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 26 Feb 2026 19:57:48 +0100 Subject: [PATCH 4/4] [devops] Fix stage condition for macOS test stages. Use 'dependencies' instead of 'stageDependencies' in the stage-level condition in mac/stage.yml. At the stage level, Azure DevOps requires 'dependencies' to access dependent stage outputs (matching the pattern already used in windows/stage.yml). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tools/devops/automation/templates/mac/stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devops/automation/templates/mac/stage.yml b/tools/devops/automation/templates/mac/stage.yml index bbe10a52975f..a7fc6657df50 100644 --- a/tools/devops/automation/templates/mac/stage.yml +++ b/tools/devops/automation/templates/mac/stage.yml @@ -58,7 +58,7 @@ stages: dependsOn: - build_macos_tests - configure_build - condition: and(succeeded(), eq(stageDependencies.configure_build.outputs['configure.decisions.RUN_MAC_TESTS'], 'true')) + condition: and(succeeded(), eq(dependencies.configure_build.outputs['configure.decisions.RUN_MAC_TESTS'], 'true')) variables: GITHUB_FAILURE_COMMENT_FILE: $(System.DefaultWorkingDirectory)/github-comment-file.md