Skip to content

test: add deterministic browser characterization suite - #4

Merged
provos merged 3 commits into
mainfrom
codex/browser-characterization-tests
Aug 13, 2026
Merged

provos merged 3 commits into
mainfrom
codex/browser-characterization-tests

Conversation

@provos

@provos provos commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an explicit offline E2E server that replaces expensive inference boundaries with deterministic depth, segmentation, checkerboard inpainting, and upscaling fakes
  • add five high-fidelity Playwright workflows for upload/slicing, segmentation, painted-mask inpainting and undo, state restoration, glTF export, and animation artifacts
  • isolate state per test, block external model traffic, record browser diagnostics, and run Chromium in CI on Node 24
  • track the npm lockfile and include the E2E support package in built distributions

Verification

  • python -m pytest: 110 passed
  • npm run test:e2e: 5 passed
  • focused Flake8 fatal checks: clean
  • wheel build and packaged python -m parallax_maker.e2e_server --help: passed
  • independent review: no remaining P1/P2 findings

Characterized existing behavior

Animation export currently writes numbered PNG frames server-side and does not start a browser download. The test records that contract without changing production behavior.

Copilot AI lite review requested due to automatic review settings August 13, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a deterministic, fully offline end-to-end (E2E) browser characterization harness for Parallax Maker by introducing a test-only server that installs model-boundary fakes and a Playwright suite that exercises real Dash UI workflows (upload/slicing, segmentation, inpainting/undo, restore, glTF export, and animation artifacts). This strengthens regression detection around UI + persistence + exporters without paying inference/network cost.

Changes:

  • Introduces parallax_maker.e2e_server and parallax_maker.e2e_support fakes/fixtures to run deterministic offline workflows and block external traffic.
  • Adds Playwright test suite + config + helpers under e2e/, plus npm scripts and lockfile tracking.
  • Extends CI workflow to run Chromium Playwright tests and upload diagnostics artifacts on failure; updates Python packaging include pattern to ship E2E support.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Expands setuptools package discovery to include subpackages (e.g., E2E support).
parallax_maker/test_e2e_support.py Unit tests covering deterministic fakes + fixture state + mask metadata.
parallax_maker/e2e_support/fixtures.py Deterministic image/state fixture creation for browser workflows.
parallax_maker/e2e_support/fakes.py Fake depth/segmentation/inpainting/upscaling plus offline/network blocking + Dash monkeypatch install.
parallax_maker/e2e_support/__init__.py Exposes E2E support helpers for the test server.
parallax_maker/e2e_server.py Test-only Dash/Flask server wiring fakes, isolated state, and artifact/state inspection endpoints.
package.json Adds Playwright E2E scripts and dev dependency.
package-lock.json Locks Playwright dependency tree for reproducible CI/local runs.
e2e/README.md Documents how to run and what the characterization suite asserts/contracts.
e2e/playwright.config.ts Single-worker Playwright configuration with optional embedded server command and diagnostics output.
e2e/parallax-maker.spec.ts High-fidelity UI characterization scenarios covering main workflows and artifact assertions.
e2e/helpers/app.ts Centralized selectors and UI interaction helpers for Dash UI automation and assertions.
e2e/fixtures.ts Playwright fixture that captures and soft-fails on browser console/page/network issues, attaching diagnostics.
.gitignore Ignores Playwright outputs (test results / report) and stops ignoring package-lock.json.
.github/workflows/python-app.yml Runs Playwright Chromium E2E in CI (Node 24), installs browsers, uploads diagnostics on failure.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread parallax_maker/e2e_support/fixtures.py
Comment thread parallax_maker/e2e_server.py Outdated
@provos
provos requested a lite review from Copilot August 13, 2026 00:43
@provos
provos requested a lite review from Copilot and removed request for Copilot August 13, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (2)

parallax_maker/e2e_support/fakes.py:282

  • The monkeypatched serve_main_image_with_unique_url wrapper hard-codes the current serve_main_image(self, image) signature. If AppState.serve_main_image gains parameters, this patch will break at runtime. Use *args/**kwargs when forwarding to the original method to keep the monkeypatch resilient.
    def serve_main_image_with_unique_url(state, image):
        url = original_serve_main_image(state, image)
        path = url.split("?", maxsplit=1)[0]
        return f"{path}?e2e-v={next(image_versions)}"

parallax_maker/e2e_support/fakes.py:164

  • _load_inpainting_base() is called immediately in the FakeInpaintingModel base class list, so it doesn’t actually defer importing parallax_maker.inpainting (and it adds indirection that makes static analysis/type checking harder). Prefer a direct import + explicit base class, or (if the goal is truly lazy import) switch to composition instead of dynamic inheritance.
def _load_inpainting_base():
    from parallax_maker.inpainting import InpaintingModel

    return InpaintingModel


class FakeInpaintingModel(_load_inpainting_base()):
    """Use the real inpainting composition around a checkerboard generator."""

@provos
provos merged commit a6a99a8 into main Aug 13, 2026
3 checks passed
@provos
provos deleted the codex/browser-characterization-tests branch September 25, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants