Skip to content

[tests] Skip macOS/Mac Catalyst tests on mismatched beta macOS versions#25829

Open
rolfbjarne wants to merge 2 commits into
xcode27.0from
dev/rolf/skip-mismatched-macos-beta-tests
Open

[tests] Skip macOS/Mac Catalyst tests on mismatched beta macOS versions#25829
rolfbjarne wants to merge 2 commits into
xcode27.0from
dev/rolf/skip-mismatched-macos-beta-tests

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

When the xcode27.0 branch targets a specific macOS beta (e.g. beta 1), CI machines may be running a different beta version, causing spurious test failures. This PR adds a mechanism to skip macOS and Mac Catalyst tests when the running macOS is a beta that doesn't match the expected one.

Approach:

  • A new EXPECTED_MACOS_BUILD_VERSION variable in Make.config stores the build version we target (currently 26A5368g for macOS 27 beta 1). A comment explains how to get the value (sysctl -n kern.osversion).
  • The run-packaged-macos-tests script accepts --expected-macos-build-version and checks kern.osversion at startup. If the running OS is a beta (build version ends with a lowercase letter) and doesn't match, it exits 0 (skipping tests gracefully).
  • Stable macOS versions (build version ends with a digit) always run tests regardless of the expected value.
  • The PowerShell CI script reads the variable from Make.config and passes it through.

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits June 26, 2026 12:57
…cOS beta version.

Add EXPECTED_MACOS_BUILD_VERSION to Make.config (currently set to 26A5368g for
macOS 27 beta 1). The run-packaged-macos-tests script checks the current macOS
build version via kern.osversion sysctl, and exits early with success if it
doesn't match the expected version. This prevents spurious test failures when
CI machines are running a different beta than what the tests target.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… match.

Stable macOS versions (build version ending in a digit, like '24G720') should
still run tests even if they don't match the expected beta build version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3939be2] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 3939be2d9724cb48cd506fb04ac23417690a6941 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 3939be2d9724cb48cd506fb04ac23417690a6941 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3939be2] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 3939be2d9724cb48cd506fb04ac23417690a6941 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #3939be2] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 200 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 3939be2d9724cb48cd506fb04ac23417690a6941 [PR build]

@rolfbjarne rolfbjarne marked this pull request as ready for review June 29, 2026 10:05
Copilot AI review requested due to automatic review settings June 29, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a CI-friendly mechanism to avoid spurious macOS/Mac Catalyst test failures when build agents are running a different macOS beta than the branch is targeting, by propagating an expected macOS build version into the packaged test runner and conditionally skipping test execution on mismatched beta builds.

Changes:

  • Add EXPECTED_MACOS_BUILD_VERSION to Make.config as the branch’s targeted macOS build version.
  • Teach run-packaged-macos-tests a new --expected-macos-build-version option and skip tests when running on a mismatched beta build.
  • Update the mac CI PowerShell runner to read the value from Make.config and pass it through to the test runner.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tools/devops/automation/scripts/run_mac_tests.ps1 Reads EXPECTED_MACOS_BUILD_VERSION from packaged Make.config and forwards it to the test runner.
scripts/run-packaged-macos-tests/run-packaged-macos-tests.cs Adds CLI arg + beta build-version check to skip running packaged mac tests on mismatched beta OS builds.
Make.config Introduces EXPECTED_MACOS_BUILD_VERSION and documents how to obtain the value.

Comment on lines +134 to +137
if (isBeta && currentBuildVersion != expectedMacOSBuildVersion) {
Console.WriteLine ($"Current macOS build version '{currentBuildVersion}' is a beta that does not match expected '{expectedMacOSBuildVersion}'. Skipping tests.");
return 0;
}
// [--timeout <seconds>] Default timeout per test in seconds (default: 300)
// [--timeout-longer <seconds>] Longer timeout for heavy tests (default: 600)
// [--launch-arguments <args>] Extra arguments passed to test executables
// [--expected-macos-build-version <v>] Expected macOS build version (skip tests if mismatched)
Comment thread Make.config

# The expected macOS build version for running tests.
# To get the build version for the current macOS, run: sysctl -n kern.osversion
# If the running macOS build version doesn't match, macOS/Mac Catalyst tests will be skipped.
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #3939be2] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 3939be2d9724cb48cd506fb04ac23417690a6941 [PR build]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants