Testing
Genie has automated tests for the backend tool layer and for the native browser packages, a smoke test for the backend WebSocket, a Playwright suite for this documentation site, and manual checklists for the assistant. There are no automated tests for chat-core, chat-ui or the standalone UI.
Commands
Run from genie/.
| Command | What it runs |
|---|---|
pnpm verify:backend | @genie/backend-core tests (node --test), then the backend WebSocket smoke test (apps/backend/integration-server.js) |
pnpm test | pnpm -r test: every workspace package with a test script (backend-core node --test, and Vitest in genome-browser, genome-track-container and genome-tracks-standard) |
pnpm typecheck | tsc --noEmit for apps/standalone |
pnpm lint | ESLint for apps/standalone |
pnpm --filter @genie/genome-browser test | One package's Vitest suite (any package name works) |
pnpm docs:test | The docs site Playwright suite (see below) |
Packages with their own typecheck script (genome-browser, genome-track-container, genome-tracks-standard, apps/docs, infra/aws-cdk, apps/genome-track-demo) can be checked with pnpm --filter <name> typecheck.
Backend tests
packages/backend-core/test/ uses the Node test runner.
| File | Tests |
|---|---|
genomePluginCompiler.test.js | The plugin compiler produces an importable ES module that exports register(); genomeCreateCustomTrack is rejected while the browser renders with eg3 |
genomeAcAcceptance.test.js | Acceptance tests for the genome tools (four tests, below) |
| Test title | Network | What it checks |
|---|---|---|
P0 acceptance: observe-act loop genome tools | Yes | Navigation, track loading, track listing and viewport description against a public ENCODE bigWig, with citation tokens |
P1 acceptance: grounded genome computations | Yes | Signal statistics, peak calls, quantification and correlation on the public bigWig and on small bedGraph fixtures with known values |
P2 acceptance: offline ENCODE fixture mapping and citations | No | Mapping of recorded ENCODE search responses to candidates, and that every candidate carries a citation token |
P2 acceptance: live public data search integration | Yes | A live ENCODE search returns bigWig candidates with ENCFF accessions and citation tokens |
Tests marked as needing the network are skipped unless you set GENIE_AC_NETWORK=1:
GENIE_AC_NETWORK=1 pnpm --filter @genie/backend-core test
Live tests depend on the ENCODE portal and its file storage, so their results can change when those services change.
WebSocket smoke test
apps/backend/integration-server.js starts the backend on TEST_PORT (default 8790), opens ws://localhost:<port>/ws, sends init with autoApprove: true and waits up to 5 seconds for connected and ready. Because init performs the app-server handshake, the test needs a working Codex CLI (or GENIE_CODEX_COMMAND).
The smoke test's default port is the same as the local cloud simulator's. If genie-local-cloud is running, use another port: TEST_PORT=8799 pnpm --filter genie-backend test:integration.
Browser package tests
| Package | File | Covers |
|---|---|---|
@genie/genome-browser | test/GenomeBrowser.test.tsx | Previous data stays visible while refetching and stale responses are ignored; cleanUp is called when a track is removed; unknown track configs are replaced once the type is registered |
@genie/genome-browser | test/StandardTrackRegistration.test.ts | Every eg-react track type has a native TrackConfig; the standalone and demo surfaces do not use the eg-react iframe runtime |
@genie/genome-track-container | test/GenomeTrackViewport.test.tsx | Imperative pan and zoom, multiple instances, pan animation, visible-window events, skeletons outside the loaded window, re-anchoring near the band edge |
@genie/genome-track-container | test/prefetch.test.ts | computeNextTargetWindow shifting, recentring and no-op cases |
@genie/genome-tracks-standard | test/trackTypes.test.ts | The eg-react track type list has no duplicates and is lower-case |
These suites exercise the native stack. The eg3 engine in vendor/eg3 is a pre-built bundle and is not tested in this repository.
Documentation site tests
apps/docs/tests/ holds a Playwright suite that tests the production build the same way a static host would serve it.
| File | Checks |
|---|---|
pages.spec.ts | The sitemap lists the full documentation set; every route resolves to an index.html file a bucket can serve; a 404.html exists; every doc page returns 200, has a visible heading and an active sidebar entry, loads all its images, shows no raw admonition or Markdown link syntax, and logs no page or console errors; internal links on every page resolve to built files |
navigation.spec.ts | Home page links into the docs; navbar sections open their sidebars; sidebar and pagination move between pages; table-of-contents links jump to headings; local search finds pages; Mermaid diagrams render as SVG; the colour mode toggle switches to the dark theme; unknown routes show the not-found page |
responsive.spec.ts | No horizontal page scroll on a phone viewport; the mobile menu opens the docs sidebar |
routes.ts | Helpers that read routes from the built sitemap.xml and map a route to the file a static host would serve |
playwright.config.ts serves apps/docs/build with scripts/static-server.mjs (a small server that resolves routes the way an S3 static website endpoint does, also used by pnpm --filter genie-docs serve) on port 3101 (DOCS_TEST_PORT) and runs two projects: desktop-chromium (1440 × 900) and mobile-chromium (Pixel 7, responsive.spec.ts only).
Download Chromium for Playwright once, build the site (the suite tests the built output), then run the suite:
pnpm --filter genie-docs test:e2e:install
pnpm --filter genie-docs build
pnpm --filter genie-docs test:e2e
The root shortcuts are pnpm docs:build and pnpm docs:test. The docs suite is not part of pnpm test, so the root test command does not need a docs build. See Docs site.
Manual checks for the assistant
The assistant depends on a model, the Codex CLI and live public services, so it is checked by hand. Run these with the assistant on (desktop app, or VITE_GENIE_ASSISTANT_ENABLED=true pnpm dev), in a fresh hg38 project, one request per message. The example prompts below come from the MYC and ALB demonstration sessions. Keep the chat's app-server.log for anything you need to investigate.
MYC example prompts (Genome mode)
- "Navigate to chr8:127,700,000-127,760,000."
- "Find public H3K27ac ChIP-seq fold-change signal for K562 on hg38 and load the best match."
- "Describe what is visible in the viewport, with numbers."
- "Call peaks on the K562 H3K27ac track across the current view and save them as a new track."
- "Summarize what we found in a short paragraph, citing each claim, and propose one testable next hypothesis."
Check that:
- Each request produces tool cards that finish, and the browser moves to the window after step 1 without a manual refresh.
- Step 2 calls
public_data_search, thengenome_add_track, and the K562 H3K27ac track (ENCFF381NDD in earlier runs) appears in the panel. - Step 3 calls
genome_describe_viewportand the reply reports values from the tool result. - Step 4 calls
genome_call_peaks, apeaks-*.bedfile appears undergenome/results/, and a peak track is added to the browser state. - Step 5 ends claims with numbered chips; each chip opens the evidence panel with a stored record; no
[[cite:...]]text is left raw in the chat.
For reference, with ENCFF381NDD earlier runs reported a viewport maximum of 19.96, mean 1.14 and minimum 0, a RepeatMasker count of 167, and seven peak intervals above a cutoff of 8.79, all within chr8:127,735,502-127,736,913. Matching numbers indicate the tools behave as in those runs; they do not test the model.
ALB example prompts (Genome mode, then Analysis mode)
- "Navigate to chr4:73,380,000-73,460,000."
- "Find public H3K27ac ChIP-seq fold-change signal for HepG2 on hg38 and load the best match."
- "Also load the matching H3K27ac signal for K562 so both are side by side."
- "Describe what is visible in the viewport, with numbers."
- "Compare the two tracks and call peaks on each."
Then ask for a short plan in an Analysis-mode chat and check that it is saved as a Report in Discovery Studio.
Check that:
- Both tracks load with the same output type (fold change over control).
- Step 5 calls
genome_correlate_tracksandgenome_call_peakstwice; the correlation result reportsr,nBinsandbinSize. - The saved Report opens from Discovery Studio.
Earlier runs reported r = 0.0022 over 500 bins of 160 bp, and 32 HepG2 and 4 K562 peak intervals (fragment counts, not element counts).
Other checks
- A request whose scope exceeds 5 Mb (for example statistics over a whole chromosome) returns the "scope too large" result rather than hanging.
- Reopening a chat replays its messages and the citation chips still resolve.
- Asset import: in Analysis mode, import a local folder or a remote URL with Import Asset and check the asset catalog.
- Desktop without the Codex CLI (set
GENIE_CODEX_COMMANDto a missing path): the app opens, the browser works, and the chat shows "AI Features Unavailable". - Cloud mode (
pnpm dev:web-cloud): create a project, add a track, reload, and check that the state persists; set General access to "Anyone with the link" and open the link in a private window.
Model output varies between runs and model versions, and ENCODE search results come from the live portal. Treat the reference numbers as a check on the tools, and read every answer against its evidence records. See Limitations.