mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(testrun): seam preflight so iOS routing tests pass on CI without xcrun
This commit is contained in:
1 parent
71019843ff
commit
b214df4b9d
2 files changed
+16
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user