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

+5 -15
View File
@@ -122,27 +122,17 @@ func TestPreflight_AllOK(t *testing.T) {
}
}
func TestPreflightDevice_NonIosIsNoop(t *testing.T) {
for _, platform := range []string{"web", "android"} {
if err := preflightDevice(platform); err != nil {
t.Errorf("%s: preflightDevice should be a no-op, got %v", platform, err)
}
}
}
func TestPreflightDevice_JavaFailurePointsAtIosDeviceDoctor(t *testing.T) {
// Neither iOS path runs a JVM, so preflight must not turn a host away for
// want of java on the platform that never asks for it.
func TestPreflight_IosDoesNotRequireJava(t *testing.T) {
check := func(name string) error {
if name == "java" {
return errors.New("java not found")
}
return nil
}
err := runPreflightDevice("ios", check)
if err == nil || !strings.Contains(err.Error(), "java") {
t.Fatalf("expected java error, got %v", err)
}
if !strings.Contains(err.Error(), "sanderling doctor --platform=ios-device") {
t.Errorf("hint must name the ios-device doctor platform: %v", err)
if err := runPreflight(context.Background(), "ios", check); err != nil {
t.Errorf("ios preflight failed on a host with no java: %v", err)
}
}