github GitoxideLabs/gitoxide gix-testtools-v0.22.0
gix-testtools v0.22.0

5 hours ago

Chore

  • make docs-rs work, and publishing

New Features

  • add rename() for replacing read-only fixture files
    I removed a lot of tests for that, assuming it's trivial enough to get right
    and existing tests that use it are proof of function enough.

    Git creates read-only commit-graph files. On Windows, this also prevents
    replacing them with std::fs::rename(), requiring fixture setup to clear
    the destination's read-only attribute first.

    Add gix_testtools::rename() to retry permission-denied renames after
    clearing that attribute. Other platforms retain std::fs::rename()
    behavior. Document that callers must use writable fixtures or fixture
    initialization and release memory mappings before replacing backing files.

  • Trace Bash fixture commands without changing captured baselines

    A flaky Windows fetch test failed while generating make_remote_repos.sh,
    before the worktree assertions ran. The fixture output stopped after cloning
    credential-helpers, leaving no failing command or process exit status to
    explain the abort. Expected merge conflicts earlier in the script further
    obscured where setup actually failed.

    Enable set -x by default for .sh fixtures on Bash 4.1 and newer. Route
    traces through BASH_XTRACEFD to a duplicate of the original stderr, so
    commands that redirect stderr into fixture baselines do not capture tracing
    output. Keep successful fixture generation quiet by retaining the runner's
    existing policy of printing captured output only on failure.

    Bash 3.2, including the version shipped with macOS, cannot redirect xtrace
    independently of stderr. Use an inherited ERR trap there to report the
    failed command, script location, and status through the same descriptor.
    Include the subprocess exit status in the runner's error on every platform.

    Add coverage for silent command lookup failures, unchanged redirected stderr
    baselines, and exit statuses in fixture errors. This improves diagnosis; it
    does not identify or fix the original Windows flake.

  • add symlink preflight for Bash fixtures

    Careful refackiew, only the tests were mostly waved through as they
    are known to be super thorough. Only their style needs checking, which
    was fine here.

    Fixtures that require symbolic links need to distinguish unavailable symlink
    creation on the host from broken fixture setup. Otherwise, tests either fail
    on unsupported filesystems or risk hiding unrelated errors when skipping.

    Inject gix_testtools_require_symlinks into Bash fixtures to probe creation
    of a real link before generating contents. Record the outcome at the fixture
    root and stop successfully when links are unavailable. Tests can then use
    fixture_has_symlinks() to skip explicitly; missing or malformed results,
    unexpected ln exits, copied files, and later setup failures remain errors.

    Preserve script arguments and Bash 3.2 source context without exporting the
    helper to child shells. Include the prelude in cache keys for fixtures using
    the probe, and document archive and writable-fixture constraints.

  • redact unstable values in diagnostic snapshots

    Complete error snapshots expose useful context and causes, but temporary
    paths, dynamically assigned ports, object IDs, and platform-specific I/O
    messages make their output unstable.

    Add redact_debug_snapshot() to apply explicit replacements, reuse object-ID
    normalization, and render OS errors by their portable ErrorKind. Handle
    plain and debug-escaped Windows paths while retaining meaningful suffixes
    and unrelated backslashes. Return an owned Debug value so insta displays
    the diagnostic without additional quoting or newline escaping.

    Cover redaction, object identity, and OS error formatting, and convert the
    environment, SBOM argument, and Rust fixture error assertions to complete
    inline snapshots. The helper is available before downstream diagnostic
    snapshot migrations need it.

Bug Fixes

  • Make checkout safety fixtures reliable on Windows

    The traversal fixture rewrites .git/index to install paths Git would not
    normally accept. MSYS sed reads that binary index in text mode, removing
    carriage returns from incidental CRLF bytes in its stat data. Variable
    timestamps make the resulting corruption intermittent. Setting the mtime to
    2000-11-01T12:31:06Z (0x3a000d0a) reproduced the reported
    U git/hooks/pre-commit and unresolved-conflict error exactly.

    Use Perl with binary standard streams and literal path substitution, which
    also works on systems without sed -b. Keep the CRLF-containing timestamp
    in every generated repository so text-mode index corruption is exercised
    deterministically by the existing checkout safety tests.

    The same log's long-path warnings come from a relative XDG_CONFIG_HOME
    being reinterpreted after the fixture changes directories. Make the isolated
    configuration path absolute, and exercise both absolute and relative fixture
    roots by checking that Git still reads the intended attributes after cd.

    Validated on Windows with Git 2.55.0.windows.3:

  • Keep rust workspace tests inside disposable repositories and isolated environments

    Direct Git launches inherited repository selectors and user configuration even
    when tests supplied a fixture working directory. Tests of default-environment
    APIs and local Git transports also shared the runner's environment. A few
    journey tests wrote beneath source directories or used the source checkout as
    the repository under test.

    Use the shared gix-testtools Git command builder for subprocess setup, isolated
    repository options for fixtures, and isolated child processes where the real
    environment-reading API must be exercised. Scope CWD changes, copy the fixture
    used by an object-write test, and run shell journeys through jtt run. Keep
    journey worktrees and example output within their disposable sandboxes and
    replace the attributes checkout test with a representative fixture repository.
    Prompt examples also run in isolated children and must build successfully; the
    old tests could ignore build failures and execute stale cached binaries.

    The affected Rust crate suites, internal test-tool build, and max-pure journey
    suite pass from a source copy without Git metadata. Signing and Git-daemon
    checks use only disposable keys, repositories, and local sockets.

  • isolate fixtures from inherited Git templates

    Fixture commands already ignore external Git configuration, but inherited
    GIT_TEMPLATE_DIR could still inject personal template files into repositories
    created by git init, making fixtures depend on the caller's environment.

    Clear that variable in the shared command setup used by fixture scripts and
    isolated Git helpers. Keep Git's installed templates available because existing
    fixtures rely on their standard files and directory layout.

    Document the isolation behavior and add a regression that supplies an external
    template containing a marker file, then verifies that git init does not copy
    it into the fixture repository.

  • keep fixture scripts isolated when they set GIT_CONFIG_COUNT themselves
    The isolation configuration (no signing, no auto-maintenance, init.defaultBranch=main)
    reached scripts only as GIT_CONFIG_COUNT variables, so a script exporting its own
    GIT_CONFIG_COUNT replaced all of it. With maintenance back on, each commit in such a
    script spawned a detached git maintenance run --auto that could outlive the script and
    mutate the fixture while it was being copied, failing tests with a bare ENOENT.

    • the isolation now lives in a global configuration file under
      tests/fixtures/generated-do-not-edit/, written once per process; a script's own
      GIT_CONFIG_COUNT layers on top of it
    • ambient GIT_CONFIG_COUNT is removed from the script environment, as it used to be
      overwritten
    • a script or git() call that writes global configuration fails with a clear message
      and the file is restored, so the mistake stays contained to the offender

Changed (BREAKING)

  • raise MSRV to Rust 1.88

    The newly published dua-core 3.3 release used by linked-worktree removal
    requires Rust 1.88, so raise every workspace crate and the advertised badge
    together.

    Keep the MSRV checks buildable by selecting the latest sysinfo and rusqlite
    release lines that support Rust 1.88.

Commit Statistics

  • 42 commits contributed to the release over the course of 62 calendar days.
  • 62 days passed between releases.
  • 10 commits were understood as conventional.
  • 0 issues like '(#ID)' were seen in commit messages

Commit Details

view details
  • Uncategorized
    • Merge pull request #3083 from GitoxideLabs/report-october (e87b6ee)
    • Release gix-error v0.5.2, gix-date v0.18.1, gix-actor v0.44.1, gix-trace v0.3.1, gix-validate v0.13.1, gix-path v0.14.1, gix-quote v0.10.1, gix-command v0.12.1, gix-hash v0.28.1, gix-fs v0.24.1, gix-tempfile v26.0.1, gix-object v0.66.1, gix-glob v0.29.1, gix-attributes v0.37.1, gix-packetline v0.24.1, gix-filter v0.36.1, gix-chunk v0.10.1, gix-commitgraph v0.42.0, gix-revwalk v0.38.0, gix-traverse v0.64.0, gix-worktree-stream v0.39.0, gix-archive v0.39.0, gix-bitmap v0.6.1, gix-lock v26.0.1, gix-index v0.58.0, gix-config-value v0.21.1, gix-pathspec v0.22.1, gix-worktree v0.59.0, gix-imara-diff v0.3.2, gix-diff v0.70.0, gix-blame v0.20.0, gix-ref v0.69.1, gix-config v0.62.1, gix-prompt v0.19.1, gix-url v0.40.1, gix-credentials v0.42.1, gix-discover v0.57.1, gix-dir v0.32.0, gix-mailmap v0.36.1, gix-revision v0.52.0, gix-merge v0.23.0, gix-negotiate v0.38.0, gix-note v0.3.1, gix-zlib v0.4.0, gix-pack v0.77.0, gix-odb v0.87.0, gix-refspec v0.47.1, gix-shallow v0.15.1, gix-transport v0.62.0, gix-protocol v0.68.0, gix-status v0.37.0, gix-submodule v0.36.1, gix-worktree-state v0.37.0, gix v0.90.0, gix-fsck v0.27.1, gitoxide-core v0.64.0, gix-tix v0.6.0, gitoxide v0.61.0, safety bump 21 crates (dd39fb6)
    • Merge pull request #3066 from GitoxideLabs/check-commit-graph (7540f69)
    • Add rename() for replacing read-only fixture files (9af9145)
    • Merge pull request #3059 from cruessler/run-gix-transport-tests-with-sha-256-2 (8dc7afd)
    • Trace Bash fixture commands without changing captured baselines (d839468)
    • Merge pull request #3053 from GitoxideLabs/various-improvements (2d8dcc4)
    • Release gix-error v0.5.1, gix-utils v0.5.1 (6d1b686)
    • Merge pull request #3048 from GitoxideLabs/new-release (5fccccf)
    • Release gix-error v0.5.0, gix-date v0.18.0, gix-actor v0.44.0, gix-trace v0.3.0, gix-validate v0.13.0, gix-path v0.14.0, gix-utils v0.5.0, gix-quote v0.10.0, gix-command v0.12.0, gix-hash v0.28.0, gix-hashtable v0.18.0, gix-parallel v0.50.0, gix-fs v0.24.0, gix-tempfile v26.0.0, gix-object v0.66.0, gix-glob v0.29.0, gix-attributes v0.37.0, gix-packetline v0.24.0, gix-filter v0.36.0, gix-chunk v0.10.0, gix-commitgraph v0.41.0, gix-revwalk v0.37.0, gix-traverse v0.63.0, gix-worktree-stream v0.38.0, gix-archive v0.38.0, gix-bitmap v0.6.0, gix-lock v26.0.0, gix-index v0.57.0, gix-config-value v0.21.0, gix-pathspec v0.22.0, gix-ignore v0.24.0, gix-worktree v0.58.0, gix-imara-diff v0.3.1, gix-diff v0.69.0, gix-blame v0.19.0, gix-ref v0.69.0, gix-sec v0.16.0, gix-config v0.62.0, gix-prompt v0.19.0, gix-url v0.40.0, gix-credentials v0.42.0, gix-discover v0.57.0, gix-dir v0.31.0, gix-mailmap v0.36.0, gix-revision v0.51.0, gix-merge v0.22.0, gix-negotiate v0.37.0, gix-note v0.3.0, gix-zlib v0.3.0, gix-pack v0.76.0, gix-odb v0.86.0, gix-refspec v0.47.0, gix-shallow v0.15.0, gix-transport v0.61.0, gix-protocol v0.67.0, gix-status v0.36.0, gix-submodule v0.36.0, gix-worktree-state v0.36.0, gix v0.89.0, gix-fsck v0.27.0, gitoxide-core v0.63.0, gix-tix v0.5.0, gitoxide v0.60.0, safety bump 62 crates (0115e90)
    • Merge pull request #3032 from GitoxideLabs/sec-audit (1d7bac7)
    • Add symlink preflight for Bash fixtures (ed9974a)
    • Merge pull request #3045 from GitoxideLabs/fix-win-ci-flake (833a97c)
    • Make checkout safety fixtures reliable on Windows (d6dab89)
    • Merge pull request #3033 from GitoxideLabs/gix-cli-progress-cleanup (80f4b03)
    • Merge pull request #3035 from any-victor/fix/clone-ignores-caller-repository-env (d2d078f)
    • Review (95043b9)
    • Merge pull request #3022 from GitoxideLabs/release-testtools (f819565)
    • Release gix-testtools v0.21.0 (f4ebb73)
    • Make docs-rs work, and publishing (385e703)
    • Merge pull request #2977 from GitoxideLabs/worktree-create (d9f7c85)
    • Merge pull request #3020 from GitoxideLabs/report-september (5fb3dcf)
    • Release gix-error v0.4.0, gix-date v0.17.0, gix-actor v0.43.0, gix-trace v0.2.0, gix-validate v0.12.0, gix-path v0.13.0, gix-utils v0.4.0, gix-quote v0.9.0, gix-command v0.11.0, gix-features v0.50.0, gix-hash v0.27.0, gix-hashtable v0.17.0, gix-fs v0.23.0, gix-tempfile v25.0.0, gix-object v0.65.0, gix-glob v0.28.0, gix-attributes v0.36.0, gix-packetline v0.23.0, gix-filter v0.35.0, gix-chunk v0.9.0, gix-commitgraph v0.40.0, gix-revwalk v0.36.0, gix-traverse v0.62.0, gix-worktree-stream v0.37.0, gix-archive v0.37.0, gix-bitmap v0.5.0, gix-lock v25.0.0, gix-index v0.56.0, gix-config-value v0.20.0, gix-pathspec v0.21.0, gix-ignore v0.23.0, gix-worktree v0.57.0, gix-imara-diff v0.3.0, gix-diff v0.68.0, gix-blame v0.18.0, gix-ref v0.68.0, gix-sec v0.15.0, gix-config v0.61.0, gix-prompt v0.18.0, gix-url v0.39.0, gix-credentials v0.41.0, gix-discover v0.56.0, gix-dir v0.30.0, gix-mailmap v0.35.0, gix-revision v0.50.0, gix-merge v0.21.0, gix-negotiate v0.36.0, gix-note v0.2.0, gix-zlib v0.2.0, gix-pack v0.75.0, gix-odb v0.85.0, gix-macros v0.2.0, gix-refspec v0.46.0, gix-shallow v0.14.0, gix-transport v0.60.0, gix-protocol v0.66.0, gix-status v0.35.0, gix-submodule v0.35.0, gix-worktree-state v0.35.0, gix v0.88.0, gix-fsck v0.26.0, gitoxide-core v0.62.0, gix-tix v0.4.0, gitoxide v0.59.0, safety bump 60 crates (37860b3)
    • Merge pull request #2847 from GitoxideLabs/gix-error-completion (6356013)
    • Redact unstable values in diagnostic snapshots (faf8510)
    • Merge pull request #2999 from GitoxideLabs/sbom (77c8cd9)
    • Add configurable CycloneDX and SPDX SBOM generation with jtt (40b8e5e)
    • Merge pull request #2989 from GitoxideLabs/error-conversion-review (4b9ff51)
    • Merge pull request #2990 from GitoxideLabs/various-improvements (c609062)
    • Keep rust workspace tests inside disposable repositories and isolated environments (4e0f8ff)
    • Isolate all Git subprocess helpers used by tests (a1834d6)
    • Merge pull request #2984 from justonemorenight/fix/config-path-tilde-parity (92b6508)
    • Isolate fixtures from inherited Git templates (42c46f4)
    • Merge pull request #2982 from mtsgrd/testtools-config-file-isolation (0cd9319)
    • Review (bc9185d)
    • Keep fixture scripts isolated when they set GIT_CONFIG_COUNT themselves (13d784d)
    • Merge pull request #2958 from GitoxideLabs/sign-on-windows (c16300c)
    • Merge pull request #2949 from GitoxideLabs/error-conversion-review (a095334)
    • Raise MSRV to Rust 1.88 (4b42e0c)
    • Merge pull request #2955 from GitoxideLabs/transport-url-encoding (7e35849)
    • Release gix-path v0.12.6, gix-error v0.3.2, gix-command v0.10.1, gix-transport v0.59.2 (888677a)
    • Merge pull request #2932 from GitoxideLabs/fundamental-types-comp (6704303)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.