test(e2e): migrate WhatsApp compact QR to Vitest - #5146
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
## Summary Migrate `test/e2e/test-whatsapp-qr-compact-e2e.sh` to a focused Vitest renderer proof and retire the shell script. Refs #5098 Refs #4522 Supersedes the simplified subset of #5146. ## Contract mapping - Legacy assertion: bundled OpenClaw / `@openclaw/whatsapp` version is resolved from `Dockerfile.base`. - Replacement: `test/e2e-scenario/live/whatsapp-qr-compact.test.ts` reads `ARG OPENCLAW_VERSION` and installs `openclaw@<version>` plus `@openclaw/whatsapp@<version>`. - Boundary preserved: pinned upstream renderer package boundary. - Legacy assertion: the WhatsApp plugin channel-login path renders through `renderQrTerminal`. - Replacement: the Vitest test scans installed `@openclaw/whatsapp/dist` for `renderQrTerminal` before measuring output. - Boundary preserved: real upstream plugin distribution path. - Legacy assertion: baseline QR without the NemoClaw preload is oversized. - Replacement: the Vitest test runs the real `renderQrTerminal(qr)` probe without `NODE_OPTIONS` and requires rows >= `WHATSAPP_QR_OVERSIZE_MIN_ROWS` (default 50). - Boundary preserved: real OpenClaw media-runtime renderer. - Legacy assertion: QR with the NemoClaw compact preload is scan-friendly and smaller. - Replacement: the Vitest test reruns the same probe with `NODE_OPTIONS=--require nemoclaw-blueprint/scripts/whatsapp-qr-compact.js`, requires rows <= `WHATSAPP_QR_COMPACT_MAX_ROWS` (default 40), and requires shrinkage versus baseline. - Boundary preserved: real preload injection and renderer behavior. ## Simplicity check - Test shape: focused Vitest test with local temp-dir helpers. - New shared helpers: none. - New framework/registry/ledger: none. - No WhatsApp account, phone scan, sandbox, Docker, or `NVIDIA_API_KEY` required; the renderer proof preserves the legacy contract. - Workflow changes: existing `whatsapp-qr-compact-e2e` regression lane now invokes the Vitest test instead of the deleted shell script. ## Verification - `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/whatsapp-qr-compact.test.ts --silent=false --reporter=default` - `npx vitest run --project cli test/whatsapp-qr-compact.test.ts test/regression-e2e-workflow.test.ts test/e2e-script-workflow.test.ts --silent=false --reporter=default` - `git diff --check` Note: full pre-push CLI test started but was killed by signal 9 on this host; the narrow required checks above passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened WhatsApp QR compact mode validation with comprehensive E2E testing of terminal output dimensions and scan-frame compatibility, including baseline and preload comparisons. * **Chores** * Modernized test infrastructure and CI/CD workflows, updated documentation references, and removed legacy test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Closing as superseded by #5187. The focused WhatsApp compact QR Vitest migration has landed there, #5098 now records test/e2e/test-whatsapp-qr-compact-e2e.sh as converted by #5187, and this draft branch also carries older migration-ledger/docs/advisor churn that has been overtaken by later merged work. Any remaining useful idea should come back as a fresh, narrow PR against current main. |
Summary
Migrates the WhatsApp compact QR reporter workflow regression from the legacy shell script into a Vitest live scenario. The regression workflow now runs the version-pinned renderer proof directly through
e2e-scenarios-liveand uploads fixture artifacts.Related Issue
Refs #4941
Refs #4522
Changes
test/e2e-scenario/live/whatsapp-qr-compact.test.tswith pinned OpenClaw package install, oversized baseline, and compact preload assertions.test/e2e/test-whatsapp-qr-compact-e2e.shinregression-e2e.yamlwith direct Vitest execution and artifact upload.test/e2e/test-messaging-providers.sh,test/whatsapp-qr-compact.test.ts, andtest/regression-e2e-workflow.test.ts.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com