Skip to content

test(cloudxr): real-browser OOB integration tests with fake adb and MockCloudXR - #1148

Open
gareth-morgan-nv wants to merge 6 commits into
gmorgan/oob-hub-token-fragmentfrom
gmorgan/oob-connect-tests
Open

gareth-morgan-nv wants to merge 6 commits into
gmorgan/oob-hub-token-fragmentfrom
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 the OOB teleop path. The merged fake-adb test double plays the headset's adb, real Chrome opens the exact URL that am start receives, the real web client (MockCloudXR build) runs in it, and the real wss.run + OOBControlHub serve it. Based on the fragment-token PR (#1318); retarget to main once that merges.

What changed

One real-browser suite, tests/python/core/cloudxr/test_oob_browser_integration.py, sharing one build, browser, hub and adb cleanup:

  • A fast /bin/sh test (always runs) that the -d URL survives shell quoting with a token containing &, ?, #, +, a space and quotes.
  • Fragment token delivery (generated and awkward configured token): the token is only in the launch URL's fragment after the route, the hub accepts the client, the page URL is cleaned, the mock session reports streaming, and no request target or Referer seen by the static server contains the token.
  • A wrong fragment token is rejected: the client logs the 1008 policy close and the hub has no headset.
  • A stream-attach timeout set in the environment travels in the bookmark and fires in the page.
  • A terminal client error from the mock session (server-disconnect range) shows the DOM error banner.

The browser cases need Chrome and an npm build, so they run only with RUN_OOB_BROWSER_TESTS=1 (-m oob_browser); a default run skips them. Chrome there ignores TLS errors, so certificate trust is bypassed, not covered. The older real-browser helpers in conftest.py and their two tests are removed; conftest.py keeps the shared fake-adb and service mocks. Adds the cryptography test dependency and the oob_browser marker in the leaf pyproject.toml.

Validation

  • RUN_OOB_BROWSER_TESTS=1 uv run --extra dev pytest test_oob_browser_integration.py in tests/python/core/cloudxr: 6 passed. The default run of that directory's adb tests (browser cases skipped): 124 passed, 5 skipped.
  • Hand mutation checks on the token cases (each made the tests fail): no token capture in the client, no sessionStorage persistence, token also in the URL query, hub accepting any token, URL not shell-quoted.
  • SKIP=check-copyright-year pre-commit run --all-files clean.
  • The attach-timeout and error-banner cases have no mutation check yet.
  • The new browser cases are not run by CI.

Known limitations / follow-ups

  • This suite does not exercise reload persistence; the jest and Playwright tests from the fragment-token PR cover it. A reload step in the browser suite was flaky and is not included.
  • There is no relaunch-after-crash case: the reliability work it would test has not landed.
  • The hub API's cross-origin refusal is not tested here: a draft test did not fail when that behaviour was reverted, so it was not shown to catch a regression.

Test plan

  • CI checks pass on this PR.

PR description drafted with Claude Code (Claude Sonnet 5.5).

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 3b11486 to 97f1cbf Compare October 14, 2026 16:11
Base automatically changed from gmorgan/MockADB to main October 23, 2026 19:51
@gareth-morgan-nv
gareth-morgan-nv force-pushed the gmorgan/oob-connect-tests branch from 97f1cbf to 5d15918 Compare October 23, 2026 23:40
Comment thread tests/python/core/cloudxr/test_oob_teleop_adb.py Outdated
Comment thread tests/python/core/cloudxr/test_oob_teleop_adb.py Fixed
Comment thread tests/python/core/cloudxr/test_oob_teleop_adb.py Outdated
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ Preview deployed: https://NVIDIA.github.io/IsaacCapture/preview/pr-1148/client/

Built from commit 319f41e. It may take a minute for the updated preview to appear.

gareth-morgan-nv and others added 4 commits October 23, 2026 21:14
…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>
…d a real browser

Real build_teleop_url -> run_oob_connect -> FakeAdb am start -> Chrome opens the
exact recorded URL -> the real web client (MockCloudXR build) registers with the
real wss.run + OOBControlHub. Covers a generated and an awkward configured
token, URL cleanup, no token in request targets or Referer, reload with a new
registration and no second am start, and rejection of a wrong fragment token.
Browser cases are opt-in (RUN_OOB_BROWSER_TESTS=1, -m oob_browser); a fast
/bin/sh test checks the -d argument survives shell quoting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
… and attach-timeout cases

Fold the fake-adb + MockCloudXR token launch test into the real-browser
run_oob_connect() tests, and add a case where a stream-attach timeout set in
the environment reaches the page through the bookmark. Drop the relaunch test
written against reliability branches that have not landed, and the plan
document describing it.

Co-Authored-By: Claude Sonnet 5.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 5d15918 to c4acaa6 Compare October 24, 2026 01:22
@gareth-morgan-nv gareth-morgan-nv changed the title test(cloudxr): real-browser run_oob_connect() tests against MockCloudXR, with anticipatory reliability-branch coverage test(cloudxr): real-browser OOB integration tests with fake adb and MockCloudXR Oct 24, 2026
@gareth-morgan-nv
gareth-morgan-nv changed the base branch from main to gmorgan/oob-hub-token-fragment October 24, 2026 01:22
@gareth-morgan-nv
gareth-morgan-nv marked this pull request as ready for review October 24, 2026 01:22
…op the old harness

Every real-browser case now shares one build, browser, hub and adb cleanup and the
same RUN_OOB_BROWSER_TESTS opt-in. The older conftest harness (which opened launch
URLs without their fragment) and its two tests are removed; the mock-failure
banner case moves to the new suite and waits for the session to stream first.

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

This branch was successfully deployed

1 active deployment
dev — 319f41eb Deployed Oct 24, 2026 by gareth-morgan-nv via publish-wheel #6006
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