Repository navigation
Add desktop e2e tests in CI and auto-migrate old metadata - #3
Merged
Merged
Conversation
- package tauri-driver 2.1.0 in nix and add it, xvfb-run and WEBKIT_WEBDRIVER (from webkitgtk_4_1) to the devshell - add e2e/ harness: WebdriverIO spawns tauri-driver, each spec runs with temp XDG dirs and its own copy of test-vault/ - add smoke specs for empty state and opening the fixture vault - add `bun run test:e2e` (xvfb-run when DISPLAY is unset), README docs - add openspec change add-desktop-e2e-tests - drop stale @ts-expect-error in vite.config.js (@types/node now present)
- check every vault a command works on for pre-schema.org metadata, warn on stderr and migrate it first; --json stdout stays clean - cache verified (mtime, size) per vault in $XDG_CACHE_HOME/cerbo/ vocabulary so unchanged vaults cost one stat per file - never rewrite while the desktop app runs: it holds desktop.lock and migrations defer; rewrite a file only if unchanged since planning - add `cerbo migrate vocabulary --if-needed`; `cerbo migrate` no longer auto-registers the current directory's vault - cerbo-desktop launcher runs the migration before starting the app, checked in installCheckPhase
- add e2e.yml: build app with `tauri build --no-bundle` in the devshell, run `bun run test:e2e` headless; cache Nix closure, target/, bun - extend openspec add-desktop-e2e-tests with CI requirement and design
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two pieces of work on this branch:
1729ccd,eded90b): the first tests that drive the realcerbo-desktopbinary.ddd71cf,3974f22): the CLI and the desktop launcher detect pre-schema.org metadata and migrate it; README updated.Desktop e2e tests
Tauri 3 is still alpha (3.0.0-alpha.5) and adds no e2e tooling, so this uses the official Tauri 2 route, which should survive the upgrade:
tauri-driver2.1.0 packaged innix/pkgs.nix(it is not in nixpkgs) and exposed as.#tauri-driver. The devshell addstauri-driver,xvfb-runandWEBKIT_WEBDRIVER. That variable points at theWebKitWebDrivershipped by the samewebkitgtk_4_1the app links, so driver and webview versions always match.e2e/): WebdriverIO 10.1.0 spawnstauri-driver. Each spec file runs with its own temporary XDG config, cache and data dirs, set through a launcher script. Specs undere2e/specs/vault/also get a fresh copy oftest-vault/. The run fails fast if the binary is missing.Indexpage.bun run test:e2eruns underxvfb-runwhenDISPLAYis unset. Usage is in the README..github/workflows/e2e.yml): runs on pushes tomain, on PRs and on manual dispatch. It reusesrelease.yml's Nix closure cache pattern under its own key, builds withbun run tauri build --no-bundlein the devshell and runs the suite headless.openspec/changes/add-desktop-e2e-tests, a newdesktop-e2e-testingcapability.Metadata migration
See
ddd71cffor details:--jsonstdout stays clean.statper file.desktop.lock.cerbo migrate vocabulary --if-needed.cerbo-desktoplauncher runs the migration before starting the app;installCheckPhaseverifies the launcher.Notes for reviewers
nix build .#cerbo-desktopcannot cache incrementally without a binary cache and would rerun the whole workspace test suite on every PR. The trade-off is recorded in the openspec design.textContentinstead.vite.config.js: dropped a now-unused@ts-expect-error. WebdriverIO pulls in@types/node, soprocessis typed.Test plan
bun run test:e2epasses locally, 3 of 3, headless, against both thenix build .#cerbo-desktopbinary and the cargo-builttarget/release/cerbo-desktop~/.config/cerboandtest-vault/are unchanged after runs (checksums andgit diffcompared)CERBO_DESKTOP_BINaborts the run with the path in the erroractionlintone2e.yml;openspec validate add-desktop-e2e-tests --strictnix build .#cerbo-frontend