Feat(testing): Add coverage macro attributes and streamline testing config for faster testing#35
Merged
bashandbone merged 6 commits intomainfrom Mar 19, 2026
Merged
Conversation
Owner
bashandbone
commented
Mar 19, 2026
- feat: Add schema; delete old CLAUDE.md for regeneration.
- fix: Fixed an issue with toml deserialization due to mismatched expectations between serialize and deserialize forms. Caught by some of the new expanded tests.
- feat(testing): Add coverage macros across codebase where appropriate; Add/update nextest config to use test groups to prevent race conditions vice running all tests on a single thread serially.
…tations between serialize and deserialize forms. Caught by some of the new expanded tests.
… Add/update nextest config to use test groups to prevent race conditions vice running all tests on a single thread serially.
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving test robustness/speed (coverage + parallelism controls), aligning config (de)serialization behavior, and documenting configuration via a JSON schema.
Changes:
- Added coverage attributes (nightly-gated) and expanded unit/integration test coverage across modules.
- Introduced nextest test groups + per-test gitconfig isolation to reduce test flakiness and enable safe parallelism.
- Updated config/schema/docs and dependency set to match revised TOML serialization expectations.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sparse_checkout_tests.rs | Reformats CLI arg arrays for readability/consistency in tests. |
| tests/performance_tests.rs | Reformats CLI arg arrays for readability/consistency in tests. |
| tests/integration_tests.rs | Reformats CLI arg arrays and assert formatting in integration tests. |
| tests/error_handling_tests.rs | Reformats CLI arg arrays and minor formatting cleanup in error tests. |
| tests/common/mod.rs | Adds per-test git config isolation via GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEM. |
| tests/command_contract_tests.rs | Reformats assertions/args; minor test readability adjustments. |
| src/utilities.rs | Excludes unit tests from coverage (nightly cfg) and adds edge-case tests. |
| src/shells.rs | Excludes unit tests from coverage (nightly cfg) and adds conversion/enum tests. |
| src/options.rs | Fixes SerializableBranch TOML serialization symmetry; adds extensive tests; excludes tests from coverage (nightly cfg). |
| src/main.rs | Enables nightly coverage attribute feature under cfg; excludes main from coverage; small formatting. |
| src/lib.rs | Enables nightly coverage attribute feature under cfg. |
| src/git_ops/simple_gix.rs | Import formatting only. |
| src/git_ops/mod.rs | Formatting-only changes around error context and args. |
| src/git_ops/gix_ops.rs | Import formatting only. |
| src/git_manager.rs | Formatting-only changes; small readability refactors. |
| src/config.rs | Formatting tweak + large new test module for config behaviors/roundtrips. |
| src/commands.rs | Formatting-only changes to clap arg attributes. |
| scripts/run-tests.sh | Removes forced single-threading and updates comments about nextest parallelism. |
| schemas/v1.0.0/submod_config_v1.0.0.json | Clarifies branch alias behavior and conflict guidance. |
| sample_config/submod.toml | Updates branch-name conflict guidance with issue link. |
| mise.toml | Removes RUST_TEST_THREADS env override. |
| hk.pkl | Updates nextest invocation to rely on profiles/groups (and CI profile). |
| Cargo.toml | Removes unused deps/features, adds toml dev-dep, and adds cfg lint configuration. |
| Cargo.lock | Lockfile updates reflecting dependency changes. |
| CLAUDE.md | Regenerates contributor guidance for updated test/CI workflow and architecture notes. |
| .serena/project.yml | Adds Serena project configuration. |
| .serena/.gitignore | Ignores Serena cache/local project config. |
| .config/nextest.toml | Adds nextest test groups/overrides for serializing repo-mutating integration tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+58
to
+62
| /// `/dev/null` so that tests never read or write the real user/system config. | ||
| fn git_cmd(&self) -> Command { | ||
| let mut cmd = Command::new("git"); | ||
| cmd.env("GIT_CONFIG_GLOBAL", &self.git_config_global); | ||
| cmd.env("GIT_CONFIG_SYSTEM", "/dev/null"); |
scripts/run-tests.sh
Outdated
Comment on lines
+94
to
+96
| # Test parallelism is managed by nextest test groups in .config/nextest.toml. | ||
| # Integration tests that modify git repos run serially within their group; | ||
| # other tests (config, contract) run in parallel. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…──────────────────────�[0m
�[38;5;238m│ �[0m�[1mSTDIN�[0m
�[38;5;238m─────┼──────────────────────────────────────────────────────────────────────────�[0m
�[38;5;238m 1�[0m �[38;5;238m│�[0m �[38;2;248;248;242mrefactor(testing): Simplify run-tests.sh to use single nextest invocation�[0m
�[38;5;238m 2�[0m �[38;5;238m│�[0m
�[38;5;238m 3�[0m �[38;5;238m│�[0m �[38;2;248;248;242mReplace per-module sequential test execution with a single nextest call�[0m
�[38;5;238m 4�[0m �[38;5;238m│�[0m �[38;2;248;248;242mthat leverages test groups for optimal scheduling. Fixes dead code ($?�[0m
�[38;5;238m 5�[0m �[38;5;238m│�[0m �[38;2;248;248;242mcheck after set -e), adds filterset-based performance test exclusion,�[0m
�[38;5;238m 6�[0m �[38;5;238m│�[0m �[38;2;248;248;242mand removes manual test module tracking.�[0m
�[38;5;238m 7�[0m �[38;5;238m│�[0m
�[38;5;238m 8�[0m �[38;5;238m│�[0m �[38;2;248;248;242mCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>�[0m
�[38;5;238m─────┴──────────────────────────────────────────────────────────────────────────�[0m
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.