Skip to content

statement-store: Add browser sanity check zombienet test#3244

Merged
AndreiEres merged 8 commits intomainfrom
ae-statement-store-browser-check
May 7, 2026
Merged

statement-store: Add browser sanity check zombienet test#3244
AndreiEres merged 8 commits intomainfrom
ae-statement-store-browser-check

Conversation

@AndreiEres
Copy link
Copy Markdown
Contributor

@AndreiEres AndreiEres commented May 6, 2026

Summary

  • Add a Playwright-driven zombienet test that runs smoldot's browser bundle (index-browser.js) inside headless Chromium against a real polkadot-sdk full node, exercising the statement-store ping-pong path that Node-based tests cannot reach (WebSocket-only transport, streaming wasm fetch, WebCrypto, the published browser entry point).
  • The test follows the existing reception harness pattern: pre-populate stmt_B on alice/bob, launch the browser runner, wait for smoldot to peer with both collators, signal READY, then the page submits stmt_A (ping) and waits for stmt_B to arrive on its subscription (pong).
  • Wire the new test into .github/workflows/zombienet.yml as zombienet-smoldot-0004-statement_store_browser, with caches for e2e-tests/browser/node_modules and ~/.cache/ms-playwright, and a conditional npx playwright install --with-deps chromium step.

Test plan

  • cargo check --tests clean for smoldot-e2e-tests
  • node --check for e2e-tests/browser/run.mjs and helpers.js
  • Local end-to-end run (zombienet native, polkadot-sdk binaries on PATH): cargo test -p smoldot-e2e-tests --test statement_store_browser -- --nocapture — five PASS: lines (bundle loaded, subscribe to topic_B, READY, ping, pong); test result: ok
  • CI: zombienet-smoldot-0004-statement_store_browser job passes

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 6, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​playwright@​1.59.110010010099100

View full report

const { send, waitForResponse, client } = window.__t;

let pingResult = null;
for (let attempt = 0; attempt < 10; attempt++) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need to repeat submit/read 10 times? Should not is pass on first try?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right; it's too defensive.

<head><meta charset="utf-8"><title>smoldot browser tests</title></head>
<body>
<script type="module">
import * as smoldot from '/smoldot/dist/mjs/index-browser.js';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very minor, but polkadot host uses Vite as a bundler maybe it make sense to also use it to build smoldot for this test. Bundlers can introduce their own problems

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

very don't want to add Vite here. I tried to keep the test very simple.

@AndreiEres AndreiEres merged commit 1f491f1 into main May 7, 2026
39 of 40 checks passed
@AndreiEres AndreiEres deleted the ae-statement-store-browser-check branch May 7, 2026 14:53
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.

4 participants