Skip to content

Feat(testing): Add coverage macro attributes and streamline testing config for faster testing#35

Merged
bashandbone merged 6 commits intomainfrom
feat/coverage-nextest-improvements
Mar 19, 2026
Merged

Feat(testing): Add coverage macro attributes and streamline testing config for faster testing#35
bashandbone merged 6 commits intomainfrom
feat/coverage-nextest-improvements

Conversation

@bashandbone
Copy link
Owner

  • 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.
Copilot AI review requested due to automatic review settings March 19, 2026 13:34
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 98.90271% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/git_manager.rs 90.42% 9 Missing ⚠️
src/options.rs 98.90% 4 Missing ⚠️
src/git_ops/mod.rs 87.50% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/config.rs 80.17% <100.00%> (+42.44%) ⬆️
src/git_ops/gix_ops.rs 41.66% <ø> (ø)
src/git_ops/simple_gix.rs 98.75% <ø> (ø)
src/main.rs 97.26% <100.00%> (+0.19%) ⬆️
src/shells.rs 93.65% <100.00%> (+35.37%) ⬆️
src/utilities.rs 77.06% <100.00%> (+15.76%) ⬆️
src/git_ops/mod.rs 76.00% <87.50%> (+0.26%) ⬆️
src/options.rs 95.85% <98.90%> (+54.13%) ⬆️
src/git_manager.rs 88.79% <90.42%> (-0.13%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
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.
bashandbone and others added 3 commits March 19, 2026 10:21
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>
@bashandbone bashandbone merged commit 38da3a9 into main Mar 19, 2026
7 checks passed
@bashandbone bashandbone deleted the feat/coverage-nextest-improvements branch March 19, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants