Skip to content

feat(ci): add blocking desktop E2E smoke test (MAT-135) - #174

Merged
mpiton merged 1 commit into
mainfrom
feat/mat-135-smoke-e2e-desktop
Jul 18, 2026
Merged

feat(ci): add blocking desktop E2E smoke test (MAT-135)#174
mpiton merged 1 commit into
mainfrom
feat/mat-135-smoke-e2e-desktop

Conversation

@mpiton

@mpiton mpiton commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Closes MAT-135.

What

Adds a blocking desktop E2E smoke test that proves the critical path through the compiled Tauri app, real IPC, the Rust engine, SQLite, and the filesystem — no mocked frontend.

  • scripts/e2e/fixture-server.py — stdlib-only local HTTP fixture on 127.0.0.1: serves a deterministic 4 MiB /fixture.bin with HEAD, full GET, and Range/206 (the engine requires Range support). --self-test validates it standalone.
  • scripts/e2e/smoke.sh — orchestrator: builds nothing itself, launches the debug binary (tauri-plugin-pilot is compiled into debug builds) with an empty temp profile, then drives the UI via tauri-pilot: paste the fixture URL in the Link Grabber, analyze, wait for the row to come online, Start All Online, wait for data-state=Completed in the Downloads view, verify the file's name, size, and SHA-256, restart the app, and check the completed download is still visible (R-01..R-04).
  • scripts/e2e/tauri.e2e.conf.json — CSP overlay for the E2E build only: production CSP blocks eval and canvas image loads, which tauri-pilot needs for driving and screenshots. Production config is untouched.
  • data-testid hooks on the paste textarea, Analyze button, Start All Online button, and download rows (data-state mirrors the row state).
  • e2e-smoke CI job (ubuntu, 30 min timeout): builds the debug binary with the overlay config, runs the smoke under xvfb-run, and on failure uploads screenshot, page HTML, console log, app logs, and the temp profile data as artifacts (R-05, R-06).

Notes

  • Profile isolation: HOME and all XDG dirs point into a mktemp -d /tmp/vxe2e.XXXXXX dir. It lives directly under /tmp because the pilot socket path is capped at ~108 bytes (SUN_LEN). XDG_RUNTIME_DIR isolation means a locally running dev instance can't collide with the test.
  • The pilot wait command silently times out when the element appears after the call, so the script polls querySelector via eval instead.
  • tauri-pilot fill throws on <textarea> (it uses the HTMLInputElement value setter); the paste zone is uncontrolled, so a plain value assignment works.
  • Verified locally: two full green runs under xvfb-run (exit 0), plus a run on a real display. Failure artifacts (screenshot, HTML, logs) verified working.
  • Branch protection: for R-05 to actually block merges, add the E2E smoke (desktop) check to the required status checks (same as changelog-check).

Out of scope (per ticket)

Exhaustive E2E of all views, tests against public hosters, 3-OS matrix.


Summary by cubic

Adds a blocking desktop E2E smoke test that drives the real Tauri app in CI to guard the download critical path. Meets Linear MAT-135 by validating the file and persistence via a local fixture and real IPC.

  • New Features

    • Adds e2e-smoke CI job: builds the debug app with tauri-plugin-pilot, runs under Xvfb, and executes the end-to-end flow.
    • Includes scripts/e2e/fixture-server.py and scripts/e2e/smoke.sh; checks name, size, SHA‑256, and post-restart visibility.
    • Adds E2E-only CSP overlay and data-testid hooks (paste-input, analyze-links, start-all-online, download-row with data-state).
    • On failure, uploads screenshot, page HTML, console/app logs, and the temp profile as diagnostics.
  • Migration

    • Add the “E2E smoke (desktop)” check to required status checks to enforce blocking.

Written for commit 70b36be. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests

    • Added an end-to-end smoke test covering link analysis, downloading, file verification, and persistence after app restart.
    • Added deterministic download fixtures and diagnostic artifact collection for failed test runs.
    • Added test identifiers to key download and link-grabber controls.
  • Chores

    • Integrated the desktop smoke test into continuous integration.
    • Added isolated test configuration and ignored generated diagnostic artifacts.
    • Documented the new desktop end-to-end coverage in the changelog.

A new e2e-smoke CI job builds the real debug binary (tauri-plugin-pilot
compiled in) with an E2E CSP overlay, launches it under xvfb with an
empty temporary profile, and drives the critical path through the actual
UI and Tauri IPC: paste a link served by a local deterministic fixture
server (HEAD + Range/206), resolve it in the Link Grabber, start the
download, wait for completion in the Downloads view, then verify the
file's name, size, and SHA-256. The app is restarted to prove the
completed download persists through SQLite.

On failure the job uploads a screenshot, page HTML, console and app
logs, and the temp profile data as diagnostic artifacts.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci frontend labels Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a deterministic desktop E2E smoke test that exercises link analysis, downloading, checksum validation, and persistence after restart. CI builds and runs the app under Xvfb, caches tauri-pilot, and uploads failure diagnostics.

Changes

Desktop E2E smoke testing

Layer / File(s) Summary
Deterministic download fixture
scripts/e2e/fixture-server.py
Serves a fixed 4 MiB payload with full and byte-range HTTP responses, plus a self-test covering headers, content, ranges, and missing paths.
Isolated desktop smoke flow
scripts/e2e/smoke.sh, scripts/e2e/tauri.e2e.conf.json, src/views/...
Runs the debug Tauri app with an isolated profile, drives link analysis and download actions, verifies file size and SHA-256, then confirms persistence after restart using E2E selectors and CSP configuration.
CI execution and diagnostics
.github/workflows/ci.yml, .gitignore, CHANGELOG.md
Adds the Linux E2E job, Tauri Pilot caching, Xvfb execution, failure artifact uploads, artifact exclusions, and changelog entry.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant SmokeScript
  participant TauriApp
  participant FixtureServer
  participant Profile
  CI->>SmokeScript: Build and run smoke test
  SmokeScript->>FixtureServer: Start deterministic fixture server
  SmokeScript->>TauriApp: Launch isolated app
  SmokeScript->>TauriApp: Analyze link and start download
  TauriApp->>FixtureServer: Request fixture.bin
  FixtureServer-->>TauriApp: Return 4 MiB payload
  TauriApp->>Profile: Persist completed download
  SmokeScript->>Profile: Verify size and SHA-256
  SmokeScript->>TauriApp: Restart app
  TauriApp->>Profile: Restore completed download row
Loading

Suggested labels: configuration, rust

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a blocking desktop E2E smoke test in CI.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

246-247: 📐 Maintainability & Code Quality | 🔵 Trivial

Confirm this check is required for merges.

The workflow defines E2E smoke (desktop), but it becomes blocking only when that exact check is required by the target branch’s protection rule or ruleset. The PR objective explicitly requires this external configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 246 - 247, Confirm that the exact “E2E
smoke (desktop)” check from the e2e-smoke workflow is configured as a required
status check in the target branch’s protection rule or ruleset, and update the
external repository configuration if necessary so it blocks merges.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/e2e/smoke.sh`:
- Around line 145-148: Update the restart persistence flow around launch_app and
the subsequent wait_for assertion to explicitly navigate to the Downloads route
after restarting, before waiting for the completed download row. Preserve the
existing fixture.bin assertion and timeout behavior once the Downloads view is
active.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 246-247: Confirm that the exact “E2E smoke (desktop)” check from
the e2e-smoke workflow is configured as a required status check in the target
branch’s protection rule or ruleset, and update the external repository
configuration if necessary so it blocks merges.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7c98ef46-ba61-4b26-8033-1cc11ad38133

📥 Commits

Reviewing files that changed from the base of the PR and between 64f61ac and 70b36be.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • .gitignore
  • CHANGELOG.md
  • scripts/e2e/fixture-server.py
  • scripts/e2e/smoke.sh
  • scripts/e2e/tauri.e2e.conf.json
  • src/views/DownloadsView/DownloadsTable.tsx
  • src/views/LinkGrabberView/ActionsBar.tsx
  • src/views/LinkGrabberView/PasteZone.tsx

Comment thread scripts/e2e/smoke.sh

@cubic-dev-ai cubic-dev-ai Bot 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.

cubic analysis

No issues found across 9 files

Linked issue analysis

Linked issue: MAT-135: [Lot 3] Ajouter un smoke E2E desktop bloquant

Status Acceptance criteria Notes
R-01 — The test drives the compiled Tauri app (not a mocked frontend) CI builds a debug binary with the pilot plugin and the smoke script launches the real debug binary and drives it via tauri-pilot.
R-02 — Test starts from an empty profile and uses no external internet smoke.sh creates an isolated temporary profile (exports HOME and XDG dirs into a mktemp dir) and the fixture server is served locally on 127.0.0.1.
R-03 — The downloaded file matches expected name, size and SHA-256 The fixture server serves a deterministic 4 MiB payload and the smoke script checks file presence, size and runs sha256sum -c against the expected SHA.
R-04 — After restart the completed download remains visible with a consistent state Downloads rows now expose data-state and data-testid; the smoke script restarts the app and waits for a download-row[data-state=Completed] and verifies the filename text.
⚠️ R-05 — Scenario is blocking in CI and fails on IPC errors, backend panic, timeout, or incorrect content A dedicated e2e-smoke CI job is added and will fail on errors/timeouts and upload diagnostics, but making it a blocking merge requirement (branch-protection required status check) is an external repo configuration change not performed by this PR.
R-06 — On failure logs, screenshot and profile data are uploaded as CI artifacts The smoke script collects screenshots, HTML, console/app logs and copies profile data into e2e-artifacts on failure; the workflow uploads e2e-artifacts when the job fails.

Re-trigger cubic

@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 26 untouched benchmarks


Comparing feat/mat-135-smoke-e2e-desktop (70b36be) with main (64f61ac)

Open in CodSpeed

@mpiton
mpiton merged commit 1211fc8 into main Jul 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci configuration documentation Improvements or additions to documentation frontend rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant