Skip to content

vox-test-harness API Reference (generated)

Crate: vox-test-harness · Version: 0.6.0 · Target: Library (lib.rs)

Shared test fixtures and harness primitives.

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;
DependencyKind
vox-astNormal
vox-configNormal
vox-secretsNormal
ModuleDescription
barriers—
diagnosis—
env_scratch—
portpicker—
spans—
synthetic_workspace—
temp_root—
workspace_paths—
Dependency Topology, diagram 19 nodes, 8 edges: vox-test-harness → vox-ast; vox-test-harness → vox-config; vox-test-harness → vox-secrets; vox-arch-check → vox-test-harness; vox-compiler → vox-test-harness; vox-db → vox-test-harness; vox-integration-tests → vox-test-harness; vox-orchestrator → vox-test-harnessvox-test-harnessvox-astvox-configvox-secretsvox-arch-checkvox-compilervox-dbvox-integration-testsvox-orchestrator
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
}
Consumer CrateRole
vox-arch-checkDirect workspace dependent
vox-compilerDirect workspace dependent
vox-dbDirect workspace dependent
vox-integration-testsDirect workspace dependent
vox-orchestratorDirect workspace dependent
KindSymbolSignatureSourceDescription
structbarriers::TestBarrierpub struct TestBarriercrates/vox-test-harness/src/barriers.rs#L7-L9A simple waitable barrier to replace sleep in tests.
fnbarriers::newpub fn new() -> Selfcrates/vox-test-harness/src/barriers.rs#L12-L14—
fnbarriers::signalpub fn signal(&self)crates/vox-test-harness/src/barriers.rs#L17-L19Signals that an event occurred.
fnbarriers::waitpub async fn wait(&self) -> boolcrates/vox-test-harness/src/barriers.rs#L23-L25Waits for a signal, with a default 5-second timeout to prevent tests from hanging indefinitely in CI.
fnbarriers::wait_with_timeoutpub async fn wait_with_timeout(&self, dur: Duration) -> boolcrates/vox-test-harness/src/barriers.rs#L28-L30Waits for a signal with a specific timeout.
structdiagnosis::TestDiagnosispub struct TestDiagnosiscrates/vox-test-harness/src/diagnosis.rs#L11-L32Structured failure record emitted to stdout for CI and doctor tooling.
enumdiagnosis::TestCategorypub enum TestCategorycrates/vox-test-harness/src/diagnosis.rs#L37-L56Compiler / tooling stage associated with a failure.
fndiagnosis::newpub fn new(crates/vox-test-harness/src/diagnosis.rs#L60Build a diagnosis with required fields; diff and related metadata start empty.
fndiagnosis::with_diffpub fn with_diff(mut self, expected: impl Into<String>, actual: impl Into<String>) -> Selfcrates/vox-test-harness/src/diagnosis.rs#L81-L85Attach expected vs actual strings for diff-oriented reporting.
fndiagnosis::emit_jsonpub fn emit_json(&self)crates/vox-test-harness/src/diagnosis.rs#L88-L92Print one line VOX_DIAGNOSIS: {json} for machine consumption.
structdiagnosis::HarnessIngestExpectationspub struct HarnessIngestExpectationscrates/vox-test-harness/src/diagnosis.rs#L97-L102Reward record for GRPO data flywheel logging.
fndiagnosis::emit_grpo_rewardpub fn emit_grpo_reward(&self)crates/vox-test-harness/src/diagnosis.rs#L105-L109—
structenv_scratch::EnvScratchpub struct EnvScratchcrates/vox-test-harness/src/env_scratch.rs#L10-L12—
fnenv_scratch::emptypub fn empty() -> Selfcrates/vox-test-harness/src/env_scratch.rs#L15-L19—
fnenv_scratch::setpub fn set(mut self, key: impl AsRef<str>, val: impl AsRef<str>) -> Selfcrates/vox-test-harness/src/env_scratch.rs#L28-L37—
fnenv_scratch::removepub fn remove(mut self, key: impl AsRef<str>) -> Selfcrates/vox-test-harness/src/env_scratch.rs#L39-L46—
fnportpicker::pick_unused_portpub fn pick_unused_port() -> Option<u16>crates/vox-test-harness/src/portpicker.rs#L7-L14Picks 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.
fnspans::dummy_spanpub fn dummy_span() -> Spancrates/vox-test-harness/src/spans.rs#L10-L12A zero-width span at position 0, suitable for test AST/HIR nodes. Use this in place of constructing Span { start: 0, end: 0 } inline.
enumsynthetic_workspace::MemberKindpub enum MemberKindcrates/vox-test-harness/src/synthetic_workspace.rs#L38-L43—
structsynthetic_workspace::MemberSpecpub struct MemberSpeccrates/vox-test-harness/src/synthetic_workspace.rs#L46-L52—
fnsynthetic_workspace::librarypub fn library(name: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L55-L63—
fnsynthetic_workspace::binarypub fn binary(name: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L65-L73—
fnsynthetic_workspace::with_descriptionpub fn with_description(mut self, desc: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L77-L80Set the Cargo.toml description field. Use this to test description-rule violations: pass a string shorter than the rule threshold.
fnsynthetic_workspace::with_deppub fn with_dep(mut self, dep: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L83-L86Declare a path dependency on another workspace member.
fnsynthetic_workspace::with_sourcepub fn with_source(mut self, body: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L90-L93Override the default lib.rs / main.rs body. Use to test code-pattern rules (forbidden patterns, docstring lint, etc.).
structsynthetic_workspace::SyntheticWorkspaceBuilderpub struct SyntheticWorkspaceBuildercrates/vox-test-harness/src/synthetic_workspace.rs#L96-L101—
fnsynthetic_workspace::newpub fn new() -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L110-L117—
fnsynthetic_workspace::memberpub fn member(mut self, spec: MemberSpec) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L119-L122—
fnsynthetic_workspace::with_git_stubpub fn with_git_stub(mut self) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L126-L129Write a .git/HEAD stub so callers that invoke git commands in the fixture directory don’t fall through to the host repo.
fnsynthetic_workspace::with_changelogpub fn with_changelog(mut self, version: impl Into<String>, date: impl Into<String>) -> Selfcrates/vox-test-harness/src/synthetic_workspace.rs#L133-L136Write a minimal CHANGELOG.md with a single released version. Required by callers that read the changelog for release-date / tag context.
fnsynthetic_workspace::with_extra_filepub fn with_extra_file(crates/vox-test-harness/src/synthetic_workspace.rs#L139Drop an arbitrary file into the workspace at rel_path (relative to root).
fnsynthetic_workspace::buildpub fn build(self) -> Result<SyntheticWorkspace>crates/vox-test-harness/src/synthetic_workspace.rs#L148-L191—
structsynthetic_workspace::SyntheticWorkspacepub struct SyntheticWorkspacecrates/vox-test-harness/src/synthetic_workspace.rs#L233-L235—
fnsynthetic_workspace::rootpub fn root(&self) -> &Pathcrates/vox-test-harness/src/synthetic_workspace.rs#L238-L240—
fnsynthetic_workspace::member_pathpub fn member_path(&self, name: &str) -> PathBufcrates/vox-test-harness/src/synthetic_workspace.rs#L243-L245Absolute path of a member crate’s directory.
structtemp_root::TempRootpub struct TempRootcrates/vox-test-harness/src/temp_root.rs#L9-L11—
fntemp_root::newpub fn new() -> anyhow::Result<Self>crates/vox-test-harness/src/temp_root.rs#L14-L18—
fntemp_root::pathpub fn path(&self) -> &Pathcrates/vox-test-harness/src/temp_root.rs#L20-L22—
fntemp_root::persistpub fn persist(self) -> std::path::PathBufcrates/vox-test-harness/src/temp_root.rs#L25-L27Persists the directory after this helper is dropped (no automatic cleanup).
fnworkspace_paths::find_workspace_rootpub fn find_workspace_root(start: impl AsRef<Path>) -> Option<PathBuf>crates/vox-test-harness/src/workspace_paths.rs#L9-L24Walk parents from start until a Cargo.toml containing a [workspace] table is found.
fnworkspace_paths::repo_root_for_testspub fn repo_root_for_tests(start: impl AsRef<Path>) -> PathBufcrates/vox-test-harness/src/workspace_paths.rs#L27-L42Prefer [vox_secrets::SecretId::VoxRepositoryRoot] (VOX_REPO_ROOT) when it points at a checkout root; otherwise walk up from start.