vcs-testkit 0.1.0

Test fixtures for git/jj automation: throwaway repos, sandboxes, and a seeded bare remote.
Documentation
  • Coverage
  • 100%
    33 out of 33 items documented1 out of 31 items with examples
  • Size
  • Source code size: 50.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 570.27 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ZelAnton/vcs-toolkit-rs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ZelAnton

vcs-testkit

Test fixtures for git/jj automation: throwaway repositories for integration tests.

📖 Full guide: on docs.rs — every fixture with examples, plus the Testing & mocking guide.

  • TempDir — a unique, self-cleaning temp directory (pid + counter, no temp-dir dependency).
  • GitSandbox — a configured git repo on branch main (deterministic identity, signing off, autocrlf=false) with scenario helpers: commit_file, branch, checkout, rev_parse, and a raw git(&[…]) escape hatch.
  • BareRemote — a populated bare repository to clone/fetch/push against locally (no network).
  • JjSandbox — a jj (git-backed) workspace with repo-scoped identity: describe, new_change, bookmark, raw jj(&[…]).
  • configure_identity — just the deterministic config, for tests whose subject is repository initialisation itself.

Everything is synchronous (std::process) and panics on failure — these are fixtures; a broken fixture should fail the test loudly at the call site. The real git / jj binaries must be on PATH, so gate tests behind #[ignore = "requires the git binary"] to keep hermetic CI green.

use vcs_testkit::{BareRemote, GitSandbox};

let repo = GitSandbox::init("my-test");
repo.commit_file("a.txt", "one\n", "first");
repo.branch("feature");

let remote = BareRemote::seeded("my-remote");
repo.git(&["remote", "add", "origin", remote.url().as_str()]);

Part of vcs-toolkit-rs; used as a dev-dependency by the vcs-git / vcs-jj / vcs-core test suites and by downstream consumers' integration tests. Depends on nothing (std only).