gridfleet-testkit 0.9.2__tar.gz → 0.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/CHANGELOG.md +8 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/PKG-INFO +1 -1
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/__init__.py +1 -1
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/client.py +17 -9
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/pyproject.toml +1 -1
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_client.py +23 -11
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/uv.lock +1 -1
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/.gitignore +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/README.md +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/__init__.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/_example_helpers.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/assets/hello-world.zip +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_android_mobile_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_android_tv_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_firetv_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_ios_simulator_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_roku_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_roku_sideload_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_tvos_screenshot.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/allocation.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/appium.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/py.typed +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/pytest_plugin.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/sessions.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/gridfleet_testkit/types.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_allocation.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_appium.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_client_test_data.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_docs_contract.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_driver_agnostic_guard.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_package_metadata.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_pytest_plugin.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_pytest_plugin_grid_run_id_injection.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_pytest_plugin_test_data.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_sessions.py +0 -0
- {gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_sessions_resolve_device_handle.py +0 -0
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the GridFleet testkit (`gridfleet-testkit` on PyPI) are documented here.
|
|
4
4
|
|
|
5
|
+
## [0.9.3](https://github.com/quidow/gridfleet/compare/gridfleet-testkit-v0.9.2...gridfleet-testkit-v0.9.3) (2026-05-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bind testkit-registered sessions to their device ([35030ef](https://github.com/quidow/gridfleet/commit/35030eff438b3d8cfa17b54f1329dfeb03dadf07))
|
|
11
|
+
* **testkit:** stop sending client-derived device identity on register ([c025d1e](https://github.com/quidow/gridfleet/commit/c025d1e10d2bd793dadc4ca167aaaf4a7a2e23e7))
|
|
12
|
+
|
|
5
13
|
## [0.9.2](https://github.com/quidow/gridfleet/compare/gridfleet-testkit-v0.9.1...gridfleet-testkit-v0.9.2) (2026-05-16)
|
|
6
14
|
|
|
7
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gridfleet-testkit
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.3
|
|
4
4
|
Summary: Supported pytest and run-orchestration helpers for GridFleet integrations
|
|
5
5
|
Project-URL: Homepage, https://github.com/quidow/gridfleet
|
|
6
6
|
Project-URL: Repository, https://github.com/quidow/gridfleet
|
|
@@ -511,11 +511,23 @@ class GridFleetClient:
|
|
|
511
511
|
run_id: str | None = None,
|
|
512
512
|
suppress_errors: bool = True,
|
|
513
513
|
) -> JsonObject | None:
|
|
514
|
-
"""
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
514
|
+
"""Register a running Appium session and wire ``driver.quit`` for notify.
|
|
515
|
+
|
|
516
|
+
The testkit does not try to derive a device identity from
|
|
517
|
+
``driver.capabilities``. ``udid`` / ``deviceName`` are not unique
|
|
518
|
+
across drivers (Roku reuses the IP, AVDs reuse port-named handles,
|
|
519
|
+
iOS simulators reuse a UDID across reboots), and the Appium driver
|
|
520
|
+
strips the ``appium:`` vendor prefix and drops nested vendor keys
|
|
521
|
+
like ``appium:gridfleet:deviceId`` from the W3C echo, so identifying
|
|
522
|
+
caps cannot be read reliably from the client side at all.
|
|
523
|
+
|
|
524
|
+
The row is registered with only ``session_id`` + capabilities; the
|
|
525
|
+
backend ``session_sync_loop`` queries the Grid hub on each cycle and
|
|
526
|
+
binds the row to its Device by reading ``slot.session.stereotype``,
|
|
527
|
+
which is prefix-stable and carries ``appium:gridfleet:deviceId``.
|
|
528
|
+
``driver.quit`` is wrapped so the first call posts to ``/finished``
|
|
529
|
+
exactly once; errors from notify are suppressed so they never break
|
|
530
|
+
the caller.
|
|
519
531
|
"""
|
|
520
532
|
capabilities = cast("JsonObject", driver.capabilities) if isinstance(driver.capabilities, dict) else {}
|
|
521
533
|
if not isinstance(capabilities, dict):
|
|
@@ -523,13 +535,9 @@ class GridFleetClient:
|
|
|
523
535
|
session_id = getattr(driver, "session_id", None)
|
|
524
536
|
if not isinstance(session_id, str) or not session_id:
|
|
525
537
|
raise RuntimeError("Created Appium driver did not expose a session ID")
|
|
526
|
-
device_id = capabilities.get("appium:gridfleet:deviceId") or capabilities.get("gridfleet:deviceId")
|
|
527
|
-
connection_target = capabilities.get("appium:udid") or capabilities.get("appium:deviceName")
|
|
528
538
|
result = self.register_session(
|
|
529
539
|
session_id=session_id,
|
|
530
540
|
test_name=test_name,
|
|
531
|
-
device_id=device_id if isinstance(device_id, str) and device_id else None,
|
|
532
|
-
connection_target=connection_target if isinstance(connection_target, str) and connection_target else None,
|
|
533
541
|
requested_capabilities=capabilities,
|
|
534
542
|
run_id=run_id,
|
|
535
543
|
suppress_errors=suppress_errors,
|
|
@@ -549,7 +549,17 @@ def test_update_session_status_patches_status(monkeypatch):
|
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
|
|
552
|
-
def
|
|
552
|
+
def test_register_session_from_driver_does_not_send_client_side_device_identity(monkeypatch):
|
|
553
|
+
"""The testkit deliberately does not attempt to identify the device.
|
|
554
|
+
|
|
555
|
+
Vendor-prefixed identifying caps do not survive the Appium driver's W3C
|
|
556
|
+
echo (``appium:`` stripped, ``appium:gridfleet:deviceId`` dropped) and
|
|
557
|
+
the stripped forms (``udid`` / ``deviceName``) are not globally unique
|
|
558
|
+
across drivers. The backend ``session_sync_loop`` reads the
|
|
559
|
+
prefix-stable ``slot.session.stereotype`` from the Grid hub instead, so
|
|
560
|
+
the registration payload carries only ``session_id`` + capabilities +
|
|
561
|
+
``test_name`` + ``run_id``.
|
|
562
|
+
"""
|
|
553
563
|
captured: JsonObject = {}
|
|
554
564
|
|
|
555
565
|
def fake_register_session(self: GridFleetClient, **kwargs: object) -> JsonObject:
|
|
@@ -561,10 +571,12 @@ def test_register_session_from_driver_extracts_gridfleet_capabilities(monkeypatc
|
|
|
561
571
|
class FakeDriver:
|
|
562
572
|
session_id = "sess-1"
|
|
563
573
|
capabilities: ClassVar[dict[str, object]] = {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
"
|
|
567
|
-
"
|
|
574
|
+
# Real Appium echo: ``appium:`` stripped, no
|
|
575
|
+
# ``appium:gridfleet:deviceId`` survives.
|
|
576
|
+
"udid": "SERIAL123",
|
|
577
|
+
"deviceName": "SERIAL123",
|
|
578
|
+
"automationName": "UiAutomator2",
|
|
579
|
+
"platformName": "ANDROID",
|
|
568
580
|
}
|
|
569
581
|
|
|
570
582
|
def quit(self) -> None:
|
|
@@ -574,16 +586,16 @@ def test_register_session_from_driver_extracts_gridfleet_capabilities(monkeypatc
|
|
|
574
586
|
client = GridFleetClient("http://manager/api")
|
|
575
587
|
|
|
576
588
|
assert client.register_session_from_driver(driver, test_name="test_login", run_id="run-1") == {"ok": True}
|
|
589
|
+
assert "device_id" not in captured
|
|
590
|
+
assert "connection_target" not in captured
|
|
577
591
|
assert captured == {
|
|
578
592
|
"session_id": "sess-1",
|
|
579
593
|
"test_name": "test_login",
|
|
580
|
-
"device_id": "dev-1",
|
|
581
|
-
"connection_target": "SERIAL123",
|
|
582
594
|
"requested_capabilities": {
|
|
583
|
-
"
|
|
584
|
-
"
|
|
585
|
-
"
|
|
586
|
-
"platformName": "
|
|
595
|
+
"udid": "SERIAL123",
|
|
596
|
+
"deviceName": "SERIAL123",
|
|
597
|
+
"automationName": "UiAutomator2",
|
|
598
|
+
"platformName": "ANDROID",
|
|
587
599
|
},
|
|
588
600
|
"run_id": "run-1",
|
|
589
601
|
"suppress_errors": True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_android_mobile_screenshot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_ios_simulator_screenshot.py
RENAMED
|
File without changes
|
|
File without changes
|
{gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/examples/test_roku_sideload_screenshot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gridfleet_testkit-0.9.2 → gridfleet_testkit-0.9.3}/tests/test_sessions_resolve_device_handle.py
RENAMED
|
File without changes
|