vox-test-harness API Reference (generated)
Crate: vox-test-harness · Version: 0.6.0 · Target: Library (lib.rs)
Shared test fixtures and harness primitives.
Crate Overview
Section titled “Crate Overview”Shared test infrastructure for Vox tooling and integration tests.
Provides shared test fixtures and harness primitives.
use vox_test_harness::spans::dummy_span;use vox_test_harness::barriers::TestBarrier;use vox_test_harness::env_scratch::EnvScratch;Workspace Dependencies
Section titled “Workspace Dependencies”| Dependency | Kind |
|---|---|
vox-ast | Normal |
vox-config | Normal |
vox-secrets | Normal |
Public API Surface
Section titled “Public API Surface”Modules
Section titled “Modules”| Module | Description |
|---|---|
barriers | — |
diagnosis | — |
env_scratch | — |
portpicker | — |
spans | — |
synthetic_workspace | — |
temp_root | — |
workspace_paths | — |
Dependency Topology
Section titled “Dependency Topology”Diagram source
graph { direction: right node vox_test_harness: "vox-test-harness" node vox_ast: "vox-ast" vox_test_harness -> vox_ast node vox_config: "vox-config" vox_test_harness -> vox_config node vox_secrets: "vox-secrets" vox_test_harness -> vox_secrets node vox_arch_check: "vox-arch-check" vox_arch_check -> vox_test_harness node vox_compiler: "vox-compiler" vox_compiler -> vox_test_harness node vox_db: "vox-db" vox_db -> vox_test_harness node vox_integration_tests: "vox-integration-tests" vox_integration_tests -> vox_test_harness node vox_orchestrator: "vox-orchestrator" vox_orchestrator -> vox_test_harness}Reverse Dependents (Used By)
Section titled “Reverse Dependents (Used By)”| Consumer Crate | Role |
|---|---|
vox-arch-check | Direct workspace dependent |
vox-compiler | Direct workspace dependent |
vox-db | Direct workspace dependent |
vox-integration-tests | Direct workspace dependent |
vox-orchestrator | Direct workspace dependent |
Deep Public Symbols (Source-Anchored)
Section titled “Deep Public Symbols (Source-Anchored)”| Kind | Symbol | Signature | Source | Description |
|---|---|---|---|---|
struct | barriers::TestBarrier | pub struct TestBarrier | crates/vox-test-harness/src/barriers.rs#L7-L9 | A simple waitable barrier to replace sleep in tests. |
fn | barriers::new | pub fn new() -> Self | crates/vox-test-harness/src/barriers.rs#L12-L14 | — |
fn | barriers::signal | pub fn signal(&self) | crates/vox-test-harness/src/barriers.rs#L17-L19 | Signals that an event occurred. |
fn | barriers::wait | pub async fn wait(&self) -> bool | crates/vox-test-harness/src/barriers.rs#L23-L25 | Waits for a signal, with a default 5-second timeout to prevent tests from hanging indefinitely in CI. |
fn | barriers::wait_with_timeout | pub async fn wait_with_timeout(&self, dur: Duration) -> bool | crates/vox-test-harness/src/barriers.rs#L28-L30 | Waits for a signal with a specific timeout. |
struct | diagnosis::TestDiagnosis | pub struct TestDiagnosis | crates/vox-test-harness/src/diagnosis.rs#L11-L32 | Structured failure record emitted to stdout for CI and doctor tooling. |
enum | diagnosis::TestCategory | pub enum TestCategory | crates/vox-test-harness/src/diagnosis.rs#L37-L56 | Compiler / tooling stage associated with a failure. |
fn | diagnosis::new | pub fn new( | crates/vox-test-harness/src/diagnosis.rs#L60 | Build a diagnosis with required fields; diff and related metadata start empty. |
fn | diagnosis::with_diff | pub fn with_diff(mut self, expected: impl Into<String>, actual: impl Into<String>) -> Self | crates/vox-test-harness/src/diagnosis.rs#L81-L85 | Attach expected vs actual strings for diff-oriented reporting. |
fn | diagnosis::emit_json | pub fn emit_json(&self) | crates/vox-test-harness/src/diagnosis.rs#L88-L92 | Print one line VOX_DIAGNOSIS: {json} for machine consumption. |
struct | diagnosis::HarnessIngestExpectations | pub struct HarnessIngestExpectations | crates/vox-test-harness/src/diagnosis.rs#L97-L102 | Reward record for GRPO data flywheel logging. |
fn | diagnosis::emit_grpo_reward | pub fn emit_grpo_reward(&self) | crates/vox-test-harness/src/diagnosis.rs#L105-L109 | — |
struct | env_scratch::EnvScratch | pub struct EnvScratch | crates/vox-test-harness/src/env_scratch.rs#L10-L12 | — |
fn | env_scratch::empty | pub fn empty() -> Self | crates/vox-test-harness/src/env_scratch.rs#L15-L19 | — |
fn | env_scratch::set | pub fn set(mut self, key: impl AsRef<str>, val: impl AsRef<str>) -> Self | crates/vox-test-harness/src/env_scratch.rs#L28-L37 | — |
fn | env_scratch::remove | pub fn remove(mut self, key: impl AsRef<str>) -> Self | crates/vox-test-harness/src/env_scratch.rs#L39-L46 | — |
fn | portpicker::pick_unused_port | pub fn pick_unused_port() -> Option<u16> | crates/vox-test-harness/src/portpicker.rs#L7-L14 | Picks an available TCP port for testing. Note: There is a small race condition between picking and using, but it is usually sufficient for local integration tests. |
fn | spans::dummy_span | pub fn dummy_span() -> Span | crates/vox-test-harness/src/spans.rs#L10-L12 | A zero-width span at position 0, suitable for test AST/HIR nodes. Use this in place of constructing Span { start: 0, end: 0 } inline. |
enum | synthetic_workspace::MemberKind | pub enum MemberKind | crates/vox-test-harness/src/synthetic_workspace.rs#L38-L43 | — |
struct | synthetic_workspace::MemberSpec | pub struct MemberSpec | crates/vox-test-harness/src/synthetic_workspace.rs#L46-L52 | — |
fn | synthetic_workspace::library | pub fn library(name: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L55-L63 | — |
fn | synthetic_workspace::binary | pub fn binary(name: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L65-L73 | — |
fn | synthetic_workspace::with_description | pub fn with_description(mut self, desc: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L77-L80 | Set the Cargo.toml description field. Use this to test description-rule violations: pass a string shorter than the rule threshold. |
fn | synthetic_workspace::with_dep | pub fn with_dep(mut self, dep: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L83-L86 | Declare a path dependency on another workspace member. |
fn | synthetic_workspace::with_source | pub fn with_source(mut self, body: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L90-L93 | Override the default lib.rs / main.rs body. Use to test code-pattern rules (forbidden patterns, docstring lint, etc.). |
struct | synthetic_workspace::SyntheticWorkspaceBuilder | pub struct SyntheticWorkspaceBuilder | crates/vox-test-harness/src/synthetic_workspace.rs#L96-L101 | — |
fn | synthetic_workspace::new | pub fn new() -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L110-L117 | — |
fn | synthetic_workspace::member | pub fn member(mut self, spec: MemberSpec) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L119-L122 | — |
fn | synthetic_workspace::with_git_stub | pub fn with_git_stub(mut self) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L126-L129 | Write a .git/HEAD stub so callers that invoke git commands in the fixture directory don’t fall through to the host repo. |
fn | synthetic_workspace::with_changelog | pub fn with_changelog(mut self, version: impl Into<String>, date: impl Into<String>) -> Self | crates/vox-test-harness/src/synthetic_workspace.rs#L133-L136 | Write a minimal CHANGELOG.md with a single released version. Required by callers that read the changelog for release-date / tag context. |
fn | synthetic_workspace::with_extra_file | pub fn with_extra_file( | crates/vox-test-harness/src/synthetic_workspace.rs#L139 | Drop an arbitrary file into the workspace at rel_path (relative to root). |
fn | synthetic_workspace::build | pub fn build(self) -> Result<SyntheticWorkspace> | crates/vox-test-harness/src/synthetic_workspace.rs#L148-L191 | — |
struct | synthetic_workspace::SyntheticWorkspace | pub struct SyntheticWorkspace | crates/vox-test-harness/src/synthetic_workspace.rs#L233-L235 | — |
fn | synthetic_workspace::root | pub fn root(&self) -> &Path | crates/vox-test-harness/src/synthetic_workspace.rs#L238-L240 | — |
fn | synthetic_workspace::member_path | pub fn member_path(&self, name: &str) -> PathBuf | crates/vox-test-harness/src/synthetic_workspace.rs#L243-L245 | Absolute path of a member crate’s directory. |
struct | temp_root::TempRoot | pub struct TempRoot | crates/vox-test-harness/src/temp_root.rs#L9-L11 | — |
fn | temp_root::new | pub fn new() -> anyhow::Result<Self> | crates/vox-test-harness/src/temp_root.rs#L14-L18 | — |
fn | temp_root::path | pub fn path(&self) -> &Path | crates/vox-test-harness/src/temp_root.rs#L20-L22 | — |
fn | temp_root::persist | pub fn persist(self) -> std::path::PathBuf | crates/vox-test-harness/src/temp_root.rs#L25-L27 | Persists the directory after this helper is dropped (no automatic cleanup). |
fn | workspace_paths::find_workspace_root | pub fn find_workspace_root(start: impl AsRef<Path>) -> Option<PathBuf> | crates/vox-test-harness/src/workspace_paths.rs#L9-L24 | Walk parents from start until a Cargo.toml containing a [workspace] table is found. |
fn | workspace_paths::repo_root_for_tests | pub fn repo_root_for_tests(start: impl AsRef<Path>) -> PathBuf | crates/vox-test-harness/src/workspace_paths.rs#L27-L42 | Prefer [vox_secrets::SecretId::VoxRepositoryRoot] (VOX_REPO_ROOT) when it points at a checkout root; otherwise walk up from start. |