mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(merge): resolve conflicts from master; keep WDA warmup + real healthy() check
This commit is contained in:
commit
f0a5abd767
4 files changed
+7
-17
No files matched your search
+4
-7
@@ -55,15 +55,12 @@ func EnsureSimulator(ctx context.Context, deviceName string, stdout io.Writer) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// BootedUDID returns the UDID of the currently booted iOS simulator, or "" if none is booted.
|
// BootedUDID returns the UDID of the currently booted iOS simulator, or "" if none is booted.
|
||||||
func BootedUDID(ctx context.Context) (string, error) {
|
func BootedUDID(ctx context.Context) string {
|
||||||
d, err := bootedSimulator(ctx)
|
d, _ := bootedSimulator(ctx)
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
if d == nil {
|
if d == nil {
|
||||||
return "", nil
|
return ""
|
||||||
}
|
}
|
||||||
return d.UDID, nil
|
return d.UDID
|
||||||
}
|
}
|
||||||
|
|
||||||
func bootedSimulator(ctx context.Context) (*simDevice, error) {
|
func bootedSimulator(ctx context.Context) (*simDevice, error) {
|
||||||
|
|||||||
@@ -82,10 +82,7 @@ func TestPickSimulator_EmptyList(t *testing.T) {
|
|||||||
func TestBootedUDID_CanceledContext(t *testing.T) {
|
func TestBootedUDID_CanceledContext(t *testing.T) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
cancel()
|
cancel()
|
||||||
udid, err := BootedUDID(ctx)
|
udid := BootedUDID(ctx)
|
||||||
if err == nil {
|
|
||||||
t.Error("expected error for canceled context, got nil")
|
|
||||||
}
|
|
||||||
if udid != "" {
|
if udid != "" {
|
||||||
t.Errorf("expected empty UDID on canceled context, got %q", udid)
|
t.Errorf("expected empty UDID on canceled context, got %q", udid)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,11 +41,7 @@ func buildDriver(ctx context.Context, options Options, stdout io.Writer) (driver
|
|||||||
"--platform", options.Platform,
|
"--platform", options.Platform,
|
||||||
}
|
}
|
||||||
if options.Platform == "ios" {
|
if options.Platform == "ios" {
|
||||||
udid, err := ios.BootedUDID(ctx)
|
if udid := ios.BootedUDID(ctx); udid != "" {
|
||||||
if err != nil {
|
|
||||||
return nil, nil, fmt.Errorf("find booted simulator: %w", err)
|
|
||||||
}
|
|
||||||
if udid != "" {
|
|
||||||
sidecarArgs = append(sidecarArgs, "--udid", udid)
|
sidecarArgs = append(sidecarArgs, "--udid", udid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -568,7 +568,7 @@ class IosDriverBackend(private val udid: String) : DriverBackend {
|
|||||||
driver.waitForAppToSettle(null, null, durationMillis.toInt())
|
driver.waitForAppToSettle(null, null, durationMillis.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun healthy() = true
|
override fun healthy() = runCatching { driver.contentDescriptor(false); true }.getOrElse { false }
|
||||||
|
|
||||||
override fun metrics(bundleId: String) = MetricsSample(0.0, 0L, 0L)
|
override fun metrics(bundleId: String) = MetricsSample(0.0, 0L, 0L)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user