mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
refactor(testrun): defer the java preflight check to the physical-device path
This commit is contained in:
1 parent
75d4294601
commit
20dab0ae2f
2 files changed
+43
-4
No files matched your search
@@ -41,18 +41,30 @@ 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.
|
||||
if err := check("xcrun"); err != nil {
|
||||
return preflightFailure("ios", err)
|
||||
}
|
||||
if err := check("java"); err != nil {
|
||||
return preflightFailure("ios", err)
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("preflight: unknown platform %q", platform)
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
if platform != "ios" {
|
||||
return nil
|
||||
}
|
||||
if err := preflightCheck("java"); err != nil {
|
||||
return preflightFailure("ios", 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",
|
||||
|
||||
Reference in new issue
Block a user