feat: release 2.2.0 with PC-only tests and execution reliability fixes
Unify task scheduling and queue state, fix Android input and observation recovery, preserve screenshot paths, and match final review criteria accurately. Add collapsible copyable results and publish the complete 2.1.0 upgrade notes. Validation: 3189 backend tests, 326 frontend tests, 24 client tests, production build and quality gates.
This commit is contained in:
1 parent
fac4ccb760
commit
be6e8c2abd
79 files changed
+2263
-277
No files matched your search
@@ -47,6 +47,35 @@ def _valid_png():
|
||||
_VALID_PNG = _valid_png()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_disconnect_prevents_late_helper_failure_from_starting_uiautomator():
|
||||
from artemis.clients.accessibility_client import HelperUnavailable
|
||||
from artemis.clients.screen_client_factory import FallbackScreenClient
|
||||
|
||||
started, released = threading.Event(), threading.Event()
|
||||
helper, factory, adb = MagicMock(), MagicMock(), MagicMock()
|
||||
|
||||
def capture():
|
||||
started.set()
|
||||
released.wait(2)
|
||||
raise HelperUnavailable("late snapshot failure")
|
||||
|
||||
helper.get_screen_data.side_effect = capture
|
||||
screen = FallbackScreenClient("test-device", helper=helper, uiautomator_factory=factory)
|
||||
driver = AndroidAdbDriver("test-device", adb, ui_adb_client=screen)
|
||||
pending = asyncio.create_task(driver.get_screen_data(skip_settling=True))
|
||||
try:
|
||||
assert await asyncio.to_thread(started.wait, 1)
|
||||
await driver.disconnect()
|
||||
finally:
|
||||
released.set()
|
||||
with pytest.raises(RuntimeError, match="观测已取消"):
|
||||
await asyncio.wait_for(pending, 2)
|
||||
factory.assert_not_called()
|
||||
adb.device.assert_not_called()
|
||||
assert screen.active_backend is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_android_driver_rejects_placeholder_without_returning_stale_screen():
|
||||
client = MagicMock()
|
||||
@@ -77,7 +106,9 @@ async def test_screen_capture_timeout_does_not_start_overlapping_sdk_calls(monke
|
||||
assert client.get_screen_data.call_count == 1
|
||||
finally:
|
||||
released.set()
|
||||
await asyncio.wait_for(driver._screen_capture_task, 2)
|
||||
with pytest.raises(TimeoutError, match="预算耗尽"):
|
||||
await asyncio.wait_for(driver._screen_capture_task, 2)
|
||||
client.get_hierarchy.assert_not_called()
|
||||
|
||||
|
||||
def test_screenshot_limit_keeps_small_and_invalid_images_unchanged():
|
||||
|
||||
Reference in new issue
Block a user