fix(testrun): delete a java check that was dead and wrong

preflightDevice was called only after web and both iOS branches had already
returned, so it never saw a platform other than android, and it returns nil for
anything but ios. The comment above the call said it was Android's java check;
Android's java check is in runPreflight. Its premise was wrong too: a physical
iOS device is runner-only over usbmux and needs no JVM. The replacement test
asserts an iOS host with no java passes preflight.

Also corrects two comments in the same file that still described iOS as routing
through the JVM sidecar, one of them naming an IosDriverBackend type that exists
nowhere in the tree.
This commit is contained in:
pj committed 2026-08-22 21:37:58 +05:30
1 parent 658574b568
commit a2dbcd1579
3 files changed
+12 -47

No files matched your search

+2 -21
View File
@@ -51,8 +51,8 @@ func runPreflight(ctx context.Context, platform string, check preflightFunc) err
}
return nil
case "ios":
// Simulator runs drive the native companion and need no JVM. The java
// requirement is deferred to the physical-device path in buildDriver.
// Neither iOS path needs a JVM: the simulator is driven by the native
// companion and a physical device runner-only over usbmux.
if err := check("xcrun"); err != nil {
return preflightFailure("ios", err)
}
@@ -62,25 +62,6 @@ func runPreflight(ctx context.Context, platform string, check preflightFunc) err
}
}
// preflightDevice runs the extra host checks the JVM sidecar path needs once we
// know a run targets a physical iOS device. Android already requires java in
// the top-level Preflight, so this only matters for ios.
func preflightDevice(platform string) error {
return runPreflightDevice(platform, preflightCheck)
}
func runPreflightDevice(platform string, check preflightFunc) error {
if platform != "ios" {
return nil
}
if err := check("java"); err != nil {
// The doctor splits simulator and device checks: java lives under the
// ios-device platform, so the hint must point there.
return preflightFailure("ios-device", err)
}
return nil
}
func preflightFailure(platform string, cause error) error {
return fmt.Errorf(
"preflight: %w\nrun `sanderling doctor --platform=%s` for full host-readiness checks",