Repository navigation
refactor(tests): replace shared corpus with per-feature snapshot dirs - #534
Merged
Merged
Conversation
📝 WalkthroughWalkthroughThe unit-test CLI now uses ChangesSnapshot corpus migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/feature/folding_range_tests.cpp`:
- Around line 436-439: The test snapshot paths can become absolute root paths
when clice::testing::test_dir is empty. Update the ASSERT_SNAPSHOT_GLOB path
composition in tests/unit/feature/folding_range_tests.cpp lines 436-439 and
tests/unit/feature/inlay_hint_tests.cpp lines 1539-1542 to join test_dir with
the feature directory safely, preserving a relative “folding_range” or
“inlay_hint” path when the base is empty.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fc7891d6-2d88-4d4c-9798-7237486a8125
📒 Files selected for processing (31)
docs/en/dev/test-and-debug.mddocs/zh/dev/test-and-debug.mdpixi.tomltests/corpus/statements/if/basic_if.cpptests/data/document_symbol/.clang-formattests/data/document_symbol/basic.cpptests/data/folding_range/.clang-formattests/data/folding_range/basic.cpptests/data/inlay_hint/.clang-formattests/data/inlay_hint/basic.cpptests/data/semantic_tokens/.clang-formattests/data/semantic_tokens/basic.cpptests/data/tu_index/.clang-formattests/data/tu_index/basic.cpptests/snapshots/document_symbol/snapshot/basic.cpp.snap.ymltests/snapshots/document_symbol/snapshot/statements/if/basic_if.cpp.snap.ymltests/snapshots/folding_range/snapshot/basic.cpp.snap.ymltests/snapshots/folding_range/snapshot/statements/if/basic_if.cpp.snap.ymltests/snapshots/inlay_hint/snapshot/basic.cpp.snap.ymltests/snapshots/inlay_hint/snapshot/statements/if/basic_if.cpp.snap.ymltests/snapshots/semantic_tokens/snapshot/basic.cpp.snap.ymltests/snapshots/semantic_tokens/snapshot/statements/if/basic_if.cpp.snap.ymltests/snapshots/tu_index/snapshot/basic.cpp.snap.ymltests/snapshots/tu_index/snapshot/statements/if/basic_if.cpp.snap.ymltests/unit/feature/document_symbol_tests.cpptests/unit/feature/folding_range_tests.cpptests/unit/feature/inlay_hint_tests.cpptests/unit/feature/semantic_tokens_tests.cpptests/unit/index/tu_index_tests.cpptests/unit/test/platform.htests/unit/unit_tests.cc
💤 Files with no reviewable changes (10)
- tests/snapshots/folding_range/snapshot/statements/if/basic_if.cpp.snap.yml
- tests/snapshots/document_symbol/snapshot/statements/if/basic_if.cpp.snap.yml
- tests/snapshots/tu_index/snapshot/statements/if/basic_if.cpp.snap.yml
- tests/corpus/statements/if/basic_if.cpp
- tests/snapshots/inlay_hint/snapshot/statements/if/basic_if.cpp.snap.yml
- tests/unit/test/platform.h
- docs/en/dev/test-and-debug.md
- tests/unit/unit_tests.cc
- tests/snapshots/semantic_tokens/snapshot/statements/if/basic_if.cpp.snap.yml
- docs/zh/dev/test-and-debug.md
This was referenced Jul 27, 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.
Why
The shared snapshot corpus (
tests/corpus/) ran every corpus file through five unrelated feature suites (folding_range, semantic_tokens, document_symbol, inlay_hint, tu_index). Language constructs do not map 1:1 across features, so each corpus file generated noise snapshots for features that do not care about it, making snapshot review scale badly.What
tests/corpus/, the--corpus-dirCLI option, thecorpus_dirglobal, and its references inpixi.tomland the docs.tests/data/<feature>/, following the existingtests/data/hover/pattern. The dump/transform logic is kept unchanged for reuse in the upcoming per-feature snapshot migration.basic.cppplus aDisableFormat: true.clang-format(fixture layout is part of the tested input; formatting would invalidate line/column-sensitive snapshots).Tests