agentleFS
nteractnteract/desktop/.agents/skills/testing/SKILL.md

testing

Skill183 starsChanged 18 days agoBSD-3-ClauseView on GitHub

Run tests, verify changes, and collect diagnostics. Use when running tests, writing new tests, verifying code changes before commit, or collecting logs for debugging.

  • Installs packages

We split this skill into the rules it gives an agent

16 rules. 0 are common, 3 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 170 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    After making changes, run the narrowest credible test first, then broader checks.

    line 21
  2. Very specific:

    Always run cargo xtask lint --fix before committing.

    line 62
  3. Very specific:

    Fixture test: Create notebook in crates/notebook/fixtures/audit-test/, create spec in e2e/specs/, add to FIXTURE_SPECS in e2e/wdio.conf.js, …

    line 139
  4. Very specific:

    Regular test: Create a spec in e2e/specs/.

    line 141
  5. Very specific:

    Use data-testid attributes.

    line 158
  6. Very specific:

    Use browser.execute() + browser.waitUntil().

    line 159
  7. Very specific:

    Use typeSlowly() for CodeMirror.

    line 160
  8. Very specific:

    Use browser.execute() for iframe testing.

    line 161
  9. Very specific:

    Use env -i for system diagnostics to avoid dev env vars (RUNTIMED_DEV, RUNTIMED_WORKSPACE_PATH) leaking through.

    line 175
  10. Distinctive:

    Read files from tarball without extracting:

    line 195
  11. Very specific:

    Daemon crashes: Check runtimed.log.1 (previous session)

    line 204
  12. Very specific:

    Upgrade failures: Search [upgrade] in notebook.log

    line 205
  13. Very specific:

    Kernel issues: Search [daemon-kernel] or kernel_status

    line 206
  14. Very specific:

    Sync errors: Search [notebook-sync] or daemon:disconnected

    line 207
  15. Very specific:

    launchd issues: Check doctor.json launchd_service status

    line 209
  16. Distinctive:

    Prefer fast integration tests over slow E2E.

    line 213

“Common” is measured: kept by at least 6 in 10 of the 170 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Testing & Verification

Quick Reference

TypeLocationCommandFramework
Browser E2Eapps/notebook/e2e/pnpm --filter notebook-ui test:e2e:browserPlaywright
Native E2Ee2e/specs/cargo xtask e2e testWebdriverIO + Mocha
Frontend unitsrc/**/__tests__/, apps/notebook/src/**/__tests__/pnpm testVitest + jsdom
Rust unitinline #[cfg(test)]cargo testbuilt-in
CLI behaviorcrates/runt/tests/*.honecargo hone testHone
Pythonpython/runtimed/tests/pytestpytest

Verification Workflow

After making changes, run the narrowest credible test first, then broader checks.

Narrow Tests by Crate

Files changedTest command
crates/runtimed/src/**cargo test -p runtimed
crates/notebook-wire/src/**cargo test -p notebook-wire && cargo test -p notebook-protocol
crates/notebook-doc/src/**cargo test -p notebook-doc
crates/notebook-protocol/src/**cargo test -p notebook-protocol
crates/notebook-sync/src/**cargo test -p notebook-sync
crates/kernel-env/src/**cargo test -p kernel-env
crates/kernel-launch/src/**cargo test -p kernel-launch
crates/runt/src/**cargo test -p runt
crates/runt-workspace/src/**cargo test -p runt-workspace
crates/runtimed-py/src/**up rebuild=true
crates/runtimed-wasm/**cargo xtask wasm then deno test --allow-read --allow-env --no-check
apps/notebook/src/**pnpm test:run
python/runtimed/src/**pytest python/runtimed/tests/test_session_unit.py -v

Multiple crates: cargo test -p runtimed -p notebook-doc.

MCP Live Verification (when nteract-dev available)

For daemon/kernel changes: up rebuild=true → create_notebook → create_cell with 1 + 1 → execute_cell → verify output is 2.

For CRDT/doc changes: create_notebook → create_cell → get_cell (verify source) → set_cell → get_cell (verify update).

For kernel-env changes: up rebuild=true → create_notebook → execute import sys; print(sys.executable) → verify Python path.

Reporting verification

State which checks ran and what they established. Distinguish compilation, narrow tests, and MCP live verification; name skipped or blocked checks and the behavior they leave unverified.

For example, after narrow tests pass but a live check is unavailable:

The daemon tests passed. I couldn't run the MCP check because nteract-dev wasn't available, so live cell execution is still unverified.

Always run cargo xtask lint --fix before committing.

Frontend Unit Tests (Vitest)

Config: vitest.config.ts (jsdom environment, globals enabled).

pnpm test         # Watch mode
pnpm test:run     # Run once

Key locations: src/components/isolated/__tests__/, src/components/outputs/__tests__/, src/components/widgets/__tests__/, apps/notebook/src/lib/__tests__/.

Rust Unit Tests

cargo test                    # All workspace tests
cargo test -p runtimed        # Specific crate
cargo test -- --nocapture     # Show println! output

Hone CLI Tests

Declarative bash-based tests in crates/runt/tests/*.hone.

cargo hone test               # All hone tests
cargo hone test cli.hone      # Specific file

Assertions: ASSERT exit_code == 0, ASSERT stdout contains "text", ASSERT stdout matches /pattern/.

Python Tests

Two venvs: workspace (.venv at root) for dev, and python/runtimed/.venv for isolated pytest.

# Setup test venv
cd python/runtimed && python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
cd ../../crates/runtimed-py && VIRTUAL_ENV=../../python/runtimed/.venv maturin develop

# Run
pytest python/runtimed/tests/test_session_unit.py -v          # Unit (no daemon)
SKIP_INTEGRATION_TESTS=1 pytest python/runtimed/tests/ -v     # Skip integration
RUNTIMED_INTEGRATION_TEST=1 pytest python/runtimed/tests/ -v  # CI mode (spawns daemon)

Browser E2E Tests

Playwright tests in apps/notebook/e2e/ are the preferred E2E surface for notebook UI, runtime, fixture, and renderer behavior. They use the Vite browser relay plus the dev daemon, avoiding the slower Tauri WebDriver app build.

pnpm --filter notebook-ui test:e2e:browser -- --project=chromium
pnpm --filter notebook-ui test:e2e:browser -- --project=chromium apps/notebook/e2e/execute-cell-output.spec.ts
pnpm --filter notebook-ui test:e2e:browser:portless -- --project=chromium

Native E2E Tests

Native WebDriverIO tests should stay focused on Tauri-specific setup: app shell boot, cwd-derived untitled notebook behavior, launcher/bootstrap behavior, and other issues that require the real Tauri process.

Running

cargo xtask e2e build       # Build with WebDriver support (required first)
cargo xtask e2e test        # Native smoke/default run
cargo xtask e2e test-all    # Native smoke plus long-tail Tauri fixtures
cargo xtask e2e test-fixture <notebook> <spec>  # Single fixture test

Adding Tests

Fixture test: Create notebook in crates/notebook/fixtures/audit-test/, create spec in e2e/specs/, add to FIXTURE_SPECS in e2e/wdio.conf.js, add to crates/xtask/src/main.rs, add to CI.

Regular test: Create a spec in e2e/specs/. It is picked up automatically if not in FIXTURE_SPECS.

Helpers (e2e/helpers.js)

HelperPurpose
waitForAppReady()Waits for toolbar (15s). Use in every before() hook
waitForKernelReady()Waits for kernel idle/busy (60s). Superset of above
executeFirstCell()Focuses first code cell, Shift+Enter
waitForCellOutput(cell)Waits for stream output
waitForOutputContaining(cell, text)Waits for specific output text
approveTrustDialog()Clicks "Trust & Install"
typeSlowly(text)Character-by-character (30ms). Required for CodeMirror
setupCodeCell()Finds/creates code cell, focuses editor, selects all

wry WebDriver Constraints

  • Use data-testid attributes. Text selectors return broken refs.
  • Use browser.execute() + browser.waitUntil(). executeAsync() is unsupported.
  • Use typeSlowly() for CodeMirror. Fast input drops characters.
  • Use browser.execute() for iframe testing. switchToFrame() is broken.

Selectors

data-testid: notebook-toolbar, save-button, add-code-cell-button, add-markdown-cell-button, start-kernel-button, restart-kernel-button, interrupt-kernel-button, run-all-button, deps-toggle, trust-dialog, trust-approve-button, deps-panel, deps-add-input.

data-slot: output-area, ansi-stream-output, ansi-error-output.

Other: [data-cell-type="code"], [data-cell-type="markdown"], .cm-content[contenteditable="true"], iframe[sandbox].

Diagnostics

Collecting

Use env -i for system diagnostics to avoid dev env vars (RUNTIMED_DEV, RUNTIMED_WORKSPACE_PATH) leaking through. env -i also clears PATH, so use the installed nteract link (~/.local/bin by default) and --channel to pick the installation.

# Nightly (system)
env -i HOME=$HOME "$HOME/.local/bin/nteract" --channel nightly diagnostics

# Stable (system)
env -i HOME=$HOME "$HOME/.local/bin/nteract" --channel stable diagnostics

# Dev daemon (no env -i needed)
RUNTIMED_DEV=1 RUNTIMED_WORKSPACE_PATH="$(pwd)" ./target/debug/runt diagnostics

Other system commands follow the same env -i pattern:

env -i HOME=$HOME "$HOME/.local/bin/nteract" --channel nightly daemon status
env -i HOME=$HOME "$HOME/.local/bin/nteract" --channel nightly daemon logs -f
env -i HOME=$HOME "$HOME/.local/bin/nteract" --channel stable ps

Read files from tarball without extracting:

tar xzf <archive>.tar.gz -O doctor.json
tar xzf <archive>.tar.gz -O runtimed.log | grep -i 'error\|panic'

What to Look For

  • Ghost windows: Context for '...' missing in notebook.log
  • Daemon crashes: Check runtimed.log.1 (previous session)
  • Upgrade failures: Search [upgrade] in notebook.log
  • Kernel issues: Search [daemon-kernel] or kernel_status
  • Sync errors: Search [notebook-sync] or daemon:disconnected
  • Frontend errors: webview:error or webview:warn in notebook.log
  • launchd issues: Check doctor.json launchd_service status

Test Philosophy

Prefer fast integration tests over slow E2E. Use E2E for critical user journeys, integration tests for daemon behavior, unit tests for algorithms.

Download now (ZIP)

  • Other versions191 projects use a version of this.

    Word for word · 1

    1. nteract/nteract★ 183100% same

    Edited · 0

    None found.

    Wrote their own version · 190

    1. modelcontextprotocol/servers★ 92ksame name
    2. lobehub/lobehub★ 84ksame name
    3. lobehub/lobe-chat★ 83ksame name
    4. penpot/penpot★ 62ksame name
    5. meteor/meteor★ 45ksame name
    6. iOfficeAI/AionUi★ 34ksame name
    7. garrytan/gbrain★ 31ksame name
    8. OpenZeppelin/openzeppelin-contracts★ 27ksame name
    9. tursodatabase/turso★ 25ksame name
    10. redis/go-redis★ 22ksame name

    180 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use bundle-dependency-prs, update-library-template and 10 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • MicrosoftSkill

      bundle-dependency-prs

      Fix broken dependency update PRs and aggregate the ones that work into one PR.

      Also in 6 projects that use this

    • MicrosoftSkill

      update-library-template

      Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.

      Also in 6 projects that use this

    • zetaloopSkill

      assign-copilot

      Assigns a GitHub issue to the Copilot coding agent, optionally specifying a custom agent. Use this when asked to assign an issue to Copilot or delegate an issue to CCA.

      Also in 3 projects that use this

    • NVIDIA-NeMoSkill

      build-and-dependency

      Build and dependency management for NeMo-RL. Covers Docker image building and running, uv usage, venv setup, and adding dependencies.

      Also in 3 projects that use this

    • timmo001Skill

      changeset-scope

      Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.

      Also in 3 projects that use this

    • NVIDIA-NeMoSkill

      linting-and-formatting

      Code style guidelines for NeMo-RL (Python and shell). Covers naming, indentation, comments, docstrings, reflection avoidance, and uv usage.

      Also in 3 projects that use this

  • In this repository9 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.