Skip to main content

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/.

CommandWhat it runs
pnpm verify:backend@genie/backend-core tests (node --test), then the backend WebSocket smoke test (apps/backend/integration-server.js)
pnpm testpnpm -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 typechecktsc --noEmit for apps/standalone
pnpm lintESLint for apps/standalone
pnpm --filter @genie/genome-browser testOne package's Vitest suite (any package name works)
pnpm docs:testThe 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.

FileTests
genomePluginCompiler.test.jsThe plugin compiler produces an importable ES module that exports register(); genomeCreateCustomTrack is rejected while the browser renders with eg3
genomeAcAcceptance.test.jsAcceptance tests for the genome tools (four tests, below)
Test titleNetworkWhat it checks
P0 acceptance: observe-act loop genome toolsYesNavigation, track loading, track listing and viewport description against a public ENCODE bigWig, with citation tokens
P1 acceptance: grounded genome computationsYesSignal 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 citationsNoMapping of recorded ENCODE search responses to candidates, and that every candidate carries a citation token
P2 acceptance: live public data search integrationYesA 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).

tip

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​

PackageFileCovers
@genie/genome-browsertest/GenomeBrowser.test.tsxPrevious 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-browsertest/StandardTrackRegistration.test.tsEvery eg-react track type has a native TrackConfig; the standalone and demo surfaces do not use the eg-react iframe runtime
@genie/genome-track-containertest/GenomeTrackViewport.test.tsxImperative pan and zoom, multiple instances, pan animation, visible-window events, skeletons outside the loaded window, re-anchoring near the band edge
@genie/genome-track-containertest/prefetch.test.tscomputeNextTargetWindow shifting, recentring and no-op cases
@genie/genome-tracks-standardtest/trackTypes.test.tsThe 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.

FileChecks
pages.spec.tsThe 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.tsHome 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.tsNo horizontal page scroll on a phone viewport; the mobile menu opens the docs sidebar
routes.tsHelpers 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)​

  1. "Navigate to chr8:127,700,000-127,760,000."
  2. "Find public H3K27ac ChIP-seq fold-change signal for K562 on hg38 and load the best match."
  3. "Describe what is visible in the viewport, with numbers."
  4. "Call peaks on the K562 H3K27ac track across the current view and save them as a new track."
  5. "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, then genome_add_track, and the K562 H3K27ac track (ENCFF381NDD in earlier runs) appears in the panel.
  • Step 3 calls genome_describe_viewport and the reply reports values from the tool result.
  • Step 4 calls genome_call_peaks, a peaks-*.bed file appears under genome/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)​

  1. "Navigate to chr4:73,380,000-73,460,000."
  2. "Find public H3K27ac ChIP-seq fold-change signal for HepG2 on hg38 and load the best match."
  3. "Also load the matching H3K27ac signal for K562 so both are side by side."
  4. "Describe what is visible in the viewport, with numbers."
  5. "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_tracks and genome_call_peaks twice; the correlation result reports r, nBins and binSize.
  • 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_COMMAND to 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.
caution

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.