refactor(device): remove single-device state and test branches
This commit is contained in:
1 parent
cbe8f4f0c6
commit
33c4a0d112
12 files changed
+175
-88
No files matched your search
@@ -404,9 +404,12 @@ class EmulatorManager:
|
||||
try:
|
||||
from artemis.core.diagnostics.engine import readiness_engine
|
||||
|
||||
readiness_engine.set_active_device_serial(detected_serial)
|
||||
# Focus the readiness report on the freshly booted
|
||||
# emulator; task routing still resolves its own
|
||||
# target from the request or the device pool.
|
||||
readiness_engine.set_probe_target_serial(detected_serial)
|
||||
except Exception as e:
|
||||
logger.debug(f"Failed to auto-select device serial: {e}")
|
||||
logger.debug(f"Failed to focus probes on the new emulator: {e}")
|
||||
return
|
||||
else:
|
||||
# Gradual progress visual indicator
|
||||
|
||||
@@ -52,7 +52,6 @@ class ReadinessEngine:
|
||||
|
||||
def __init__(self):
|
||||
self._probes: dict[str, BaseProbe] = {}
|
||||
self._active_device_serial: str | None = None
|
||||
self._python_probe = PythonRuntimeProbe()
|
||||
self._config_probe = SystemConfigProbe()
|
||||
self._toolchain_probe = ToolchainProbe()
|
||||
@@ -81,24 +80,19 @@ class ReadinessEngine:
|
||||
"""Remove a diagnostic probe."""
|
||||
self._probes.pop(probe_id, None)
|
||||
|
||||
def set_active_device_serial(self, serial: str | None) -> None:
|
||||
"""Set user-selected active target device serial."""
|
||||
self._active_device_serial = serial
|
||||
def set_probe_target_serial(self, serial: str | None) -> None:
|
||||
"""Set the diagnostics probes' preferred device serial.
|
||||
|
||||
This is a probe/report preference only (which device the readiness
|
||||
report highlights and verifies first). Task routing never reads it
|
||||
back: execution targets come from explicit request serials or the
|
||||
device pool. Pass None to clear the preference, e.g. after switching
|
||||
ADB server endpoints.
|
||||
"""
|
||||
self.invalidate_cache()
|
||||
if hasattr(self._adb_probe, "set_target_serial"):
|
||||
self._adb_probe.set_target_serial(serial)
|
||||
|
||||
def get_active_device_serial(self) -> str | None:
|
||||
"""Get currently selected active device serial."""
|
||||
if self._report_cache and self._report_cache.active_device:
|
||||
if self._report_cache.active_device.is_locked is False:
|
||||
return self._report_cache.active_device.serial
|
||||
if self._active_device_serial:
|
||||
return self._active_device_serial
|
||||
if self._report_cache and self._report_cache.active_device:
|
||||
return self._report_cache.active_device.serial
|
||||
return None
|
||||
|
||||
async def run_probe(self, probe_id: str) -> ProbeResult | None:
|
||||
"""Execute a single specific probe by ID."""
|
||||
probe = self._probes.get(probe_id)
|
||||
|
||||
Reference in new issue
Block a user