test: downstream wire-compat (vectors + smoke)#1
Conversation
Phase 2 of ether/etherpad#7923. Vendors core's canonical wire-format fixture and verifies the etherpad-client crate decodes it identically. - tests/fixtures/wire-vectors.json: vendored canonical vectors (override via ETHERPAD_WIRE_VECTORS). - tests/vectors.rs: server-free; applies each vector's changeset to its initialText using the crate's own parser + ot::apply and asserts the resulting text. Run with `cargo test --test vectors`. - tests/smoke.rs: live, #[ignore]'d; pushes a marker via PadSession and verifies round-trip via HTTP getText (apikey) or a fresh session. Skips cleanly when no server is reachable. Run with `cargo test --test smoke -- --ignored`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Code Review by Qodo
1.
|
Address Qodo review on PR #1: - Treat fetch_pad_cookie / connect / handshake failures as skip conditions (eprintln + return) instead of expect(), so a reachable-but-not-Etherpad endpoint skips cleanly rather than hard-failing. Doc comment updated to match. - Use uuid::Uuid::now_v7() for the pad id instead of epoch seconds to avoid collisions across concurrent/quick-retry runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks @qodo-free-for-open-source-projects — both bugs fixed in ada8caf:
|
Implements the per-kind orchestration (clone @ pinned ref, inject core's freshly-generated wire-vectors fixture via ETHERPAD_WIRE_VECTORS, run each client's vectorTest + smokeCmd against the booted server) in a testable run-clients.sh, and flips the three manifest entries to enabled, pinned to the commits that carry their Phase 2 tests: ether/pad#1, ether/etherpad-cli-client#136, ether/etherpad-desktop#78. Validated end-to-end locally against a real core: all three clients' vectors + live smoke pass. Refs should be bumped to the squash-merge commits once those client PRs land. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The three client Phase-2 PRs merged; bump each manifest ref from its pre-merge PR-branch tip (now deleted / unfetchable) to its squash-merge commit on main: etherpad-pad -> 91620c6 (ether/pad#1) etherpad-cli-client -> ebc516e (ether/etherpad-cli-client#136) etherpad-desktop -> ab83da6 (ether/etherpad-desktop#78) Verified each merged main carries the test entry points (vectors.rs/smoke.rs; test:vectors/test:smoke scripts). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…7927) * ci(downstream): robust per-client error handling in run-clients.sh (Qodo) - Move clone/fetch/checkout inside the per-client guarded block with explicit '|| exit 1' on every step. set -e is suspended inside a subshell used as an '||' operand, so relying on it silently swallowed clone/checkout failures (and continued from the wrong cwd); explicit guards make one client's failure a per-client fail=1 while the loop continues, and the run exits non-zero. - Stop suppressing fetch errors; fetch only when the pinned commit isn't already reachable, and surface the real error. - Run manifest commands via 'bash -c' instead of 'eval' (trusted in-repo allowlist; avoids double-parsing / leaking into this script's shell). Verified: two bogus clients -> both reported, loop continues, exit 1; happy path (cli, no server) -> vectors pass, smoke skips, exit 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci(downstream): pin clients to their merged-commit SHAs The three client Phase-2 PRs merged; bump each manifest ref from its pre-merge PR-branch tip (now deleted / unfetchable) to its squash-merge commit on main: etherpad-pad -> 91620c6 (ether/pad#1) etherpad-cli-client -> ebc516e (ether/etherpad-cli-client#136) etherpad-desktop -> ab83da6 (ether/etherpad-desktop#78) Verified each merged main carries the test entry points (vectors.rs/smoke.rs; test:vectors/test:smoke scripts). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci(downstream): run manifest commands under bash strict mode (Qodo) bash -c spawns a fresh shell without -e/-u/-o pipefail, so a pipeline-stage failure inside a client's vectorTest/smokeCmd could be masked. Use 'bash -euo pipefail -c' so those failures surface as a non-zero exit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR Summary by Qodo
Add wire-compat vectors fixture and live smoke test for etherpad-client
🧪 Tests🕐 20-40 MinutesWalkthroughs
User Description
Phase 2 of ether/etherpad#7923
Phase 1 (ether/etherpad#7923) added a canonical wire-format fixture that every Etherpad client must decode identically. This PR is the downstream half for the Rust
etherpad-clientcrate: it vendors that fixture and proves the crate's changeset decoder + OT apply path stays in lockstep with core's serialization.No production code changed — test files and a vendored JSON fixture only.
Files added
crates/etherpad-client/tests/fixtures/wire-vectors.json— the canonical vectors, vendored verbatim. Path overridable viaETHERPAD_WIRE_VECTORSso core CI can inject a fresh copy.crates/etherpad-client/tests/vectors.rs— server-free, runs in normal CI. Loads the fixture (serde_json) and, for each vector, applieschangesettoinitialTextusing the crate's ownchangeset::parser::parse+ot::apply(the same codechangeset_roundtrip.rs/ot_apply.rsexercise), then asserts the result equalsresultText. Covers plain insert/delete, formatted insert (*0), multiline insert (|2), and attribute reuse.crates/etherpad-client/tests/smoke.rs— live,#[ignore]'d. Connects aPadSessionto a fresh pad, sends a changeset inserting a known marker, and verifies the round-trip via the HTTPgetTextAPI (when an apikey is supplied) or a freshPadSession'sinitial_text. Modeled on theintegration_etherpad.rsskip pattern: if no server is reachable it prints a skip message and returnsOkrather than failing.Manifest commands core runs
cargo test --test vectors— passes (all 5 vectors).cargo test --test smoke -- --ignored— runs the live smoke test; compiles and lists with no server viacargo test --test smoke -- --ignored --list.Env contract
ETHERPAD_WIRE_VECTORS— override fixture path (default: vendoredtests/fixtures/wire-vectors.json).ETHERPAD_SMOKE_URL— smoke base URL (fallbackPAD_ETHERPAD_BASE, thenhttp://localhost:9003).ETHERPAD_SMOKE_APIKEY— apikey for the HTTPgetTextverification path.Notes
Applying a changeset produces only TEXT; attribute pools annotate spans but don't change the resulting characters, so the
poolfield is loaded for schema fidelity with core's fixture but isn't needed to verify text output. No decoder bug was found — the existing parser + apply handle all five vectors as-is.🤖 Generated with Claude Code
AI Description
Diagram
High-Level Assessment
The following are alternative approaches to this PR:
1. Fetch vectors from upstream at test time (URL/artifact)
2. Embed vectors directly in Rust test source
3. Submodule/subtree sync from Etherpad core testdata directory
Recommendation: The current approach (vendored JSON fixture with an env override, plus a server-free vectors test and an ignored live smoke test) is the best balance of determinism and real-world coverage: CI stays stable/offline by default while core CI can inject a fresh fixture or run the smoke test against a real server when desired.
File Changes
Tests (3)