Skip to content

test: add gitoxide integration test coverage and move matrix to Rust xtask#208

Merged
avihut merged 2 commits intomasterfrom
daft-207/gitoxide-tests
Feb 15, 2026
Merged

test: add gitoxide integration test coverage and move matrix to Rust xtask#208
avihut merged 2 commits intomasterfrom
daft-207/gitoxide-tests

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 15, 2026

Summary

  • Fix four gitoxide backend bugs discovered by running the full integration suite under gitoxide:
    • Use workdir().is_some() instead of !is_bare() for linked worktrees (gitoxide reports is_bare() == true for linked worktrees of bare repos)
    • Use full status iterator (into_iter) instead of into_index_worktree_iter to detect staged (HEAD-vs-index) changes
    • Disable empty directory emission to match git CLI behavior (git ignores empty dirs)
    • Use merge_base() for accurate rev_list_count range calculations instead of walking until the "from" commit is hit
  • Isolate integration tests from user's global git config by setting GIT_CONFIG_GLOBAL to a test-specific file
  • Add test-matrix xtask subcommand that drives integration tests across a matrix of configurations (default + gitoxide), replacing the dual-pass shell orchestration
  • Simplify test_all.sh to a stateless single-pass runner; matrix logic now lives in Rust
  • Add unit tests for new gitoxide code paths and matrix data model

Test plan

  • mise run test-unit passes (including new gitoxide and xtask matrix tests)
  • mise run clippy passes with zero warnings
  • mise run test-integration runs full matrix (default + gitoxide)
  • mise run test-integration-gitoxide convenience alias works
  • cargo run --package xtask -- test-matrix --list lists available entries
  • Individual test files still work standalone: cd tests/integration && ./test_clone.sh

Fixes #207

🤖 Generated with Claude Code

avihut and others added 2 commits February 15, 2026 08:05
Isolate integration tests from user's global git config by setting
GIT_CONFIG_GLOBAL to a test-specific file. Run the full 184-test suite
twice (git CLI + gitoxide backend) to ensure both code paths work.

Fix four gitoxide bugs revealed by the dual-pass testing:
- Use workdir().is_some() instead of !is_bare() for linked worktrees
- Use full status iterator to detect staged (HEAD-vs-index) changes
- Disable empty directory emission to match git CLI behavior
- Use merge_base() for accurate rev_list_count range calculations

Fixes #207

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the dual-pass test matrix logic from shell scripts into a new
`test-matrix` xtask subcommand. Shell scripts become stateless
single-pass runners, while Rust manages which configurations to test.

- Add TestMatrix subcommand with MatrixEntry data model and runner
- Simplify test_all.sh to single-pass (remove DAFT_TEST_GITOXIDE support)
- Make GIT_CONFIG_GLOBAL conditional in test_framework.sh
- Remove dead helpers: enable_gitoxide_global, cleanup_work_dir, reset_test_counters
- Update mise tasks to use cargo run --package xtask -- test-matrix
- Add test-integration-matrix task for running specific entries

Fixes #207

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut changed the title refactor: move integration test matrix to Rust xtask test: add gitoxide integration test coverage and move matrix to Rust xtask Feb 15, 2026
@avihut avihut added this to the v1.1.0 milestone Feb 15, 2026
@avihut avihut added bug Something isn't working fix Bug fix refactor Code refactoring test Adding/updating tests labels Feb 15, 2026
@avihut avihut self-assigned this Feb 15, 2026
@avihut avihut merged commit b12cd1f into master Feb 15, 2026
4 checks passed
@avihut avihut deleted the daft-207/gitoxide-tests branch February 15, 2026 06:43
This was referenced Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fix refactor Code refactoring test Adding/updating tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests fail with gitoxide

1 participant