fix(testrun): seam preflight so iOS routing tests pass on CI without xcrun

This commit is contained in:
pj committed 2026-06-09 18:36:19 +05:30
1 parent 71019843ff
commit b214df4b9d
2 files changed
+16 -1

No files matched your search

+11
View File
@@ -16,6 +16,7 @@ import (
type stubDeviceDriver struct{ driver.DeviceDriver }
func TestBuildDriverRoutesPhysicalIOSToDeviceDriver(t *testing.T) {
stubPreflight(t)
original := newDeviceDriver
t.Cleanup(func() { newDeviceDriver = original })
@@ -51,6 +52,7 @@ func TestBuildDriverRoutesPhysicalIOSToDeviceDriver(t *testing.T) {
}
func TestBuildDriverSurfacesDeviceConstructionError(t *testing.T) {
stubPreflight(t)
original := newDeviceDriver
t.Cleanup(func() { newDeviceDriver = original })
newDeviceDriver = func(context.Context, ioscompanion.DeviceOptions) (driver.DeviceDriver, func(), error) {
@@ -63,6 +65,15 @@ func TestBuildDriverSurfacesDeviceConstructionError(t *testing.T) {
}
}
// stubPreflight bypasses the host-readiness checks so routing tests exercise
// driver construction on a Linux CI runner that lacks xcrun/java.
func stubPreflight(t *testing.T) {
t.Helper()
original := preflight
t.Cleanup(func() { preflight = original })
preflight = func(context.Context, string) error { return nil }
}
func swapIOSResolveSeams(t *testing.T) {
t.Helper()
origTarget, origDevice, origEnsure := iosResolveTarget, iosResolveDevice, iosEnsureSimulator