Skip to content

test(cloudxr): real-browser run_oob_connect() tests against MockCloudXR, with anticipatory reliability-branch coverage - #1148

Draft
gareth-morgan-nv wants to merge 2 commits into
gmorgan/MockADBfrom
gmorgan/oob-connect-tests
Draft

gareth-morgan-nv wants to merge 2 commits into
gmorgan/MockADBfrom
gmorgan/oob-connect-tests

Conversation

@gareth-morgan-nv

@gareth-morgan-nv gareth-morgan-nv commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Real-browser integration tests for run_oob_connect(), standardized on MockCloudXR (npm run build:app-mock) rather than the real @nvidia/cloudxr SDK: the real SDK genuinely tries to stream against whatever's on backend_port, which is unpredictable and gives a test nothing to assert against. MockCloudXR mounts the identical App.tsx/CloudXRComponent.tsx UI with a fully deterministic, externally controllable session (window.__mockCloudXRFail(message?, code?)), and never opens a socket of its own.
  • Always a static production build, never a dev-server (static_webxr_build()). Two real bugs made this necessary: webpack HMR duplicating the cloudxr-mock-alias.ts module instance (so the crash-trigger silently bound to an empty session), and <React.StrictMode> double-invoking CloudXR.createSession() in a dev-mode build. webpack.app-mock.js now builds in production mode. Also found and fixed: a stale webpack persistent filesystem cache silently serving an old bundle — cleared before every build now.
  • Three real-browser tests: the original success path, a new test proving the crash-trigger mechanism itself (real, deterministic, DOM-visible error banner on demand), and an anticipatory test written against gmorgan/oob-error-relaunch (cloudxr: auto-relaunch the teleop tab on a terminal client error (depends on #1138, #1145) #1146) before it's merged here — asserts on black-box observable recovery (a second real am start, a second real tab), so it fails cleanly today and should turn green once cloudxr: auto-relaunch the teleop tab on a terminal client error (depends on #1138, #1145) #1146 lands.
  • Also added test_build_teleop_url_forwards_reliability_config_from_env, the same "write it now, let it fail until merged" approach applied to gmorgan/oob-reliability-config-wiring (cloudxr: wire client reconnect/warm-up-timeout config through OOB launch #1145)'s config forwarding — no browser needed for that one.
  • Design/decisions captured in oob-real-browser-integration-test-plan.md (repo root, §8 has the final-state summary).
  • Still depends on gmorgan/MockADB (test(cloudxr): reusable fake-adb test double (FakeAdb/mock_adb) #1147) for FakeAdb/mock_adb() — base branch unchanged.
  • Manual-run only for now; not yet wired into CI.

Test plan

  • uv run pytest test_oob_teleop_adb.py test_oob_teleop_env.py test_oob_teleop_hub.py test_fake_adb.py test_wss_static_client.py -q — 141 passed, 2 expected anticipatory failures (config-wiring, auto-relaunch — both intentionally fail until their respective branches merge)
  • SKIP=check-copyright-year pre-commit run on all changed files — clean
  • npx eslint/npx prettier --check on changed TS files — clean

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@gareth-morgan-nv
gareth-morgan-nv marked this pull request as draft September 29, 2026 14:43
@gareth-morgan-nv gareth-morgan-nv changed the title test(cloudxr): end-to-end tests for run_oob_connect() using mock_adb test(cloudxr): real-browser integration test for run_oob_connect() Sep 29, 2026
@gareth-morgan-nv gareth-morgan-nv changed the title test(cloudxr): real-browser integration test for run_oob_connect() test(cloudxr): real-browser run_oob_connect() tests against MockCloudXR, with anticipatory reliability-branch coverage Sep 29, 2026
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch 2 times, most recently from 55922d6 to 3e68d67 Compare September 30, 2026 16:18
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 3e68d67 to 59575f2 Compare October 5, 2026 17:29
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/MockADB branch 2 times, most recently from 53cb15d to 068d47f Compare October 8, 2026 23:28
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 5f9c5b9 to b418850 Compare October 8, 2026 23:32
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from b418850 to 2e6a8aa Compare October 9, 2026 01:12
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 2e6a8aa to bef59c6 Compare October 9, 2026 02:13
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch 2 times, most recently from 901cb05 to 3b11486 Compare October 13, 2026 22:17
gareth-morgan-nv and others added 2 commits October 14, 2026 12:11
…XR, with anticipatory reliability-branch coverage

Real-browser integration tests for run_oob_connect(), standardized on
MockCloudXR (npm run build:app-mock) rather than the real @nvidia/cloudxr
SDK, always against a static production build (never a dev-server, to
avoid webpack HMR module-duplication and React.StrictMode double-session
bugs found during development). Includes anticipatory tests written
against #1145/#1146 before they merged, so they fail cleanly until those
branches land. Design/decisions are in oob-real-browser-integration-test-plan.md.

Rebased onto #1147's current tip (gmorgan/MockADB) after #1147's own
history was rewritten by its rebase onto main; squashed from the original
7-commit history to avoid replaying commits whose content already landed
on #1147 under different SHAs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
…ndings

- RealBrowserAdb's am start/forward branches built CompletedProcess directly,
  bypassing the check=True handling #1147 just added to FakeAdb - a caller
  passing check=True (as _adb_forward_cdp() does) got no CalledProcessError
  on a simulated forward/am-start failure. Route both branches through the
  same check-honoring result() helper FakeAdb uses.
- real_wss_proxy() restored TELEOP_OOB_HUB_ONLY on exit but not
  CXR_INSTALL_DIR, leaking it into later tests in the same process.
- Removed a duplicated comment line and two stale docstrings/messages that
  described #1146 as not yet merged (it has, onto this branch).
- Dropped static_webxr_build()'s npm_build_script/build_dir_name parameters:
  every call site always passed the same pair, and the other pair was
  explicitly "not for tests."
- Extracted the three tests' identical 8-line port/dir/env setup into a
  shared real_browser_env() helper in conftest.py.
- Trimmed oob-real-browser-integration-test-plan.md from a 404-line
  exploration journal (superseded sections kept alongside the final state)
  down to the parts that are still useful as reference: what's real vs
  faked, the two build bugs found, the command inventory, and the test list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 3b11486 to 97f1cbf Compare October 14, 2026 16:11

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants