Skip python_install_emulated_macos except on ARM64 macos with rosetta (#16687)

## Summary

This test isn't useful on non-arm64 macs, and it outright fails if
rosetta isn't installed.

## Test Plan

Run it on my rosetta-stripped macbook
This commit is contained in:
Zsolt Dollenstein 2025-11-12 13:48:16 +00:00 committed by GitHub
parent 1b38b47a3f
commit 2de987ed37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2694,7 +2694,7 @@ fn python_install_no_cache() {
");
}
#[cfg(target_os = "macos")]
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
#[test]
fn python_install_emulated_macos() {
let context: TestContext = TestContext::new_with_versions(&[])
@ -2702,6 +2702,20 @@ fn python_install_emulated_macos() {
.with_managed_python_dirs()
.with_python_download_cache();
let arch_status = Command::new("/usr/bin/arch")
.arg("-x86_64")
.arg("true")
.status();
if !arch_status.is_ok_and(|x| x.success()) {
// Rosetta is not available to run the x86_64 interpreter
// fail the test in CI, otherwise skip it
if env::var("CI").is_ok() {
panic!("x86_64 emulation is not available on this CI runner");
}
debug!("Skipping test because x86_64 emulation is not available");
return;
}
// Before installation, `uv python list` should not show the x86_64 download
uv_snapshot!(context.filters(), context.python_list().arg("3.13"), @r"
success: true