testing-reef

Solid

Conventions and gotchas for writing tests in the reef Rust workspace — unit, integration, property, snapshot, benchmark, and fuzz. Use whenever adding or modifying a test in reef or test-support, or when the user asks "add a test for X", "how should I test Y", "why is this test flaky", "where does this test go", or anything about test fixtures, snapshots, proptest, or CI test failures. Also use when touching clock/time code (requires splitting `*_at(now, t)` helpers), or any code that mutates `cwd`/`HOME` (needs process-wide lock). Covers file-placement rules, the `test-support` fixture crate, insta filters, proptest strategy construction, and the specific pitfalls we've paid for in production — macOS tempdir symlinks, env-var sharing across parallel tests, and the HOME-redirect pattern for prefs-reading code.

Testing & QA 81 stars 6 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 84/100

Stars 20%
64
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Testing in the reef workspace A project-specific test playbook. Follow this when adding **any** test. The goal is that tests are deterministic across Linux/macOS CI and every dev's laptop, and that no test becomes that one flaky thing everyone reruns. ## Workspace layout Reef is a single-process binary plus shared internal crates. There is no plugin subsystem. - **`crates/reef-app`** — renderer-neutral app engine, task orchestration, command dispatch, snapshots, and app-state tests. - **`crates/reef-tui` (`reef` crate)** — terminal adapter, TUI rendering, input/mouse decoding, terminal image protocol, `tests/` (terminal adapter / UI integration), `benches/` (criterion). - **`crates/reef-core`** — UI-independent git, diff, preview, markdown, highlight, nav/LSP, file-op, host parsing, and history logic. - **`crates/reef-agent` / `crates/reef-proto` / `crates/reef-sqlite-preview`** — remote agent/protocol and SQLite preview support. - **`crates/test-support`** — shared fixtures (`tempdir_repo`, `commit_file`, `write_file`, `HomeGuard`). - **`fuzz/`** — fuzz targets. Separate package, not in the workspace; run via `cargo +nightly fuzz run <target>`. ## Quick decision table | Scenario | Test type | Where it goes | |----------|-----------|---------------| | Pure function, no I/O | Unit test | `#[cfg(test)] mod tests` inline at bottom of the source file | | Renderer-neutral app engine / worker contract | Integration test | `crates/reef-app/tests/<name>_integration.rs` | | Ba...

Details

Author
Blushyes
Repository
Blushyes/reef
Created
4 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category