Add direct library-API tests for git2_ops, gix_ops, and GitOpsManager#38
Merged
bashandbone merged 4 commits intomainfrom Mar 20, 2026
Merged
Conversation
…Manager Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test coverage for git2 and gix ops modules
Add direct library-API tests for git2_ops, gix_ops, and GitOpsManager
Mar 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds direct library-API integration tests to cover the git_ops backend layer (git2_ops, gix_ops, and GitOpsManager) without routing through the CLI, improving confidence in backend behavior and fallback chains.
Changes:
- Introduces
tests/git_ops_tests.rswith broad coverage forGit2Operations,GixOperations, andGitOpsManager. - Adds tests for config read/write behavior and known gix key-format limitations, plus gix stub/deferred-operation behavior.
- Adds focused tests for
SubmoduleStatusFlagsbitflags behavior andGitConfigstruct basics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bashandbone
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage for the git ops backend layer was near zero because all existing tests route through the CLI binary. This PR adds
tests/git_ops_tests.rswith 67 tests that callGit2Operations,GixOperations, andGitOpsManagerdirectly.Coverage added
Git2Operationsworkdir,read/write_gitmodules,read/write_git_config,set_config_value,list_submodulesget_submodule_statusagainst a real submoduleGixOperationsread/write_gitmodules(including file-creation verification),read/write_git_config(local only—global correctly fails)add_submodule,get_submodule_status) and all "deferred to git2" stubs (reset, clean, stash, all sparse ops)write_git_config: keys like"user.name"split into an empty name segment and are rejected;set_config_valueconsequently always fails when the repo has any pre-existing local configGitOpsManagerworkdir,reopen, the full gix→git2 fallback chain for config and list operations, the gix→git2→CLI triple-fallback forapply_sparse_checkoutData types
SubmoduleStatusFlagsbitflags (empty, single, combined, intersection) andGitConfigstructNotes
The
write_git_config/set_config_valuelimitation inGixOperations(3-part key requirement) is a pre-existing implementation gap—not introduced here—but is now explicitly tested and documented in the test comments.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
invalid-host/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add git@invalid-host:user/repo.git --name invalid-test --path lib/invalid git add origin e/git-submodule git conf�� user.name Test User ndor/bin/git ndor/bin/git git /home/REDACTED/.lousage: $dashless $USAGE git(dns block)/usr/bin/ssh /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@invalid-host git-upload-pack 'user/repo.git' -b main /usr/bin/git -b main nfig/composer/ve--bare git init�� /home/REDACTED/.do.(dns block)/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add git@invalid-host:user/repo.git --name invalid-test --path lib/invalid p/bin/git k/submod/submod/git git /home/REDACTED/worHEAD git conf�� user.name Test User it it git t git(dns block)nonexistent.domain.invalid/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add REDACTED --name invalid-test --path lib/invalid ndor/bin/git --all-progress-igit --revs rgo/bin/git git conf�� user.name Test User t HEAD refs/heads/main k/_temp/ghcca-nouser.email git(dns block)/usr/lib/git-core/git-remote-http /usr/lib/git-core/git-remote-http origin REDACTED git conf�� low test@example.com k/_temp/ghcca-node/node/bin/git(dns block)/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add REDACTED --name invalid-test --path lib/invalid git /tmp/.tmp7A6JIz/git git tnet/tools/git git -C lib/new read-tree /usr/sbin/git HEAD it ndor/bin/git git(dns block)nonexistent.invalid.domain.test/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add REDACTED --name timeout-test --path lib/timeout it(dns block)/usr/lib/git-core/git-remote-http /usr/lib/git-core/git-remote-http origin REDACTED(dns block)/home/REDACTED/work/submod/submod/target/debug/submod /home/REDACTED/work/submod/submod/target/debug/submod add REDACTED --name timeout-test --path lib/timeout p/bin/git README.md git /home/REDACTED/worlib/sparse-test basename /usr�� p/bin/git git k/_temp/ghcca-node/node/bin/git -b(dns block)If you need me to access, download, or install something from one of these locations, you can either:
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.