-
Notifications
You must be signed in to change notification settings - Fork 60
[test] add workspace loading test #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: 蔡略 <cailue@apache.org>
|
Warning Rate limit exceeded@ClSlaid has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 54 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughAdds a new naive TOML test configuration and a unit test that parses and validates that configuration (project dirs and three rule blocks with various pattern/append/remove forms). Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (2)
tests/data/config/naive/clice.toml (2)
8-8: Pattern mismatch with test expectations.The pattern
"../*.cc"doesn't match the test expectation of"**/*.cc"(see test line 30). This inconsistency was already flagged in the test file review.
10-10: Remove value mismatch with test expectations.The remove value
"-std=c++17"doesn't match the test expectation of"-foo"(see test line 34). This inconsistency was already flagged in the test file review.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/data/config/naive/clice.toml(1 hunks)tests/unit/Server/Config.cpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: build (windows-2025)
- GitHub Check: linux (ubuntu-24.04, debug)
- GitHub Check: macos (macos-15, debug)
- GitHub Check: linux (ubuntu-24.04, release)
- GitHub Check: windows (windows-2025)
- GitHub Check: macos (macos-15, release)
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
🔇 Additional comments (4)
tests/unit/Server/Config.cpp (2)
9-9: Verify relative path works in all test environments.The relative path assumes tests are executed from the repository root. Ensure this holds true across local development environments and CI pipelines.
46-48: LGTM! Empty rule verification is correct.The test correctly verifies that the empty rule block (defined in the TOML as an empty
[[rules]]section) has no patterns, append, or remove values.tests/data/config/naive/clice.toml (2)
1-4: LGTM! Project configuration is well-defined.The project section correctly defines cache and index directories using the
${workspace}variable substitution pattern.
18-19: LGTM! Empty rule block correctly defined.The empty
[[rules]]block appropriately tests the parser's handling of rules with no configured fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (3)
tests/unit/Server/Config.cpp (3)
17-17: Critical: Incorrect workspace expectation (previously flagged).This issue was already identified in a previous review and remains unaddressed. The test expects
workspace == "clice", butConfig::parse()assigns the parameterNAIVE_WORKSPACE("tests/data/config/naive") directly toconf.workspace.Apply this diff to fix the expectation:
- expect(that % conf.workspace == "clice"); + expect(that % conf.workspace == "tests/data/config/naive");
30-30: Critical: Pattern mismatch (previously flagged).This issue was already identified in a previous review and remains unaddressed. The test expects
"**/*.cc", but the TOML configuration defines"../*.cc".Apply this diff to match the TOML data:
- expect(that % str_rule.patterns[0] == "**/*.cc"); + expect(that % str_rule.patterns[0] == "../*.cc");
34-34: Critical: Remove value mismatch (previously flagged).This issue was already identified in a previous review and remains unaddressed. The test expects
"-foo", but the TOML configuration defines"-std=c++17".Apply this diff to match the TOML data:
- expect(that % str_rule.remove[0] == "-foo"); + expect(that % str_rule.remove[0] == "-std=c++17");
🧹 Nitpick comments (1)
tests/unit/Server/Config.cpp (1)
36-48: Consider extracting magic strings to constants.The test uses many hard-coded string literals for expected values. For improved maintainability and readability, consider extracting them as named constants, especially for the longer values like the Chinese text.
Example refactor:
const std::string EXPECTED_TS_PATTERN = "../*.ts"; const std::string EXPECTED_TSX_PATTERN = "../*.tsx"; const std::string EXPECTED_ES6_TARGET = "--target=es6"; // ... etcThis would make the test more self-documenting and easier to update if the test data changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/unit/Server/Config.cpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: windows (windows-2025)
- GitHub Check: linux (ubuntu-24.04, release)
- GitHub Check: macos (macos-15, release)
- GitHub Check: linux (ubuntu-24.04, debug)
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: build (windows-2025)
26c084a to
2a52860
Compare
Signed-off-by: 蔡略 <cailue@apache.org>
2a52860 to
f518638
Compare
This PR adds test for config loading.
Part of #224
Summary by CodeRabbit