test: add tests for subvalues by timestamp#53
Conversation
|
Warning Rate limit exceeded
⌛ 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. 📝 WalkthroughWalkthroughAdded three new CLI integration tests for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/cli_tests.rs`:
- Around line 828-847: Update the test function
test_review_annotations_create_with_invalid_subvalues_json to assert the
specific JSON parse error instead of only .failure(): after building the command
(coval()...arg("--ground-truth-subvalues").arg("not valid json")), replace or
augment the final .assert().failure() with an assertion that checks stderr
contains the expected JSON-parse error message (e.g., something mentioning
"invalid JSON" or "failed to parse" for the --ground-truth-subvalues input) so
the test verifies the correct failure path rather than any generic failure.
- Around line 723-826: The mocks for POST in
test_review_annotations_create_with_subvalues and PATCH in
test_review_annotations_update_with_subvalues only assert method/path/header;
add a request-body assertion to each Mock::given chain to verify the client is
sending ground_truth_subvalues_by_timestamp. Concretely, augment the POST mock
for path "/v1/review-annotations" and the PATCH mock for path
"/v1/review-annotations/ann123" with an additional .and(body_json(json!(...)))
(or an equivalent body matcher) that asserts the JSON contains the expected
ground_truth_subvalues_by_timestamp array entries (matching the same objects
used in the test coval() --ground-truth-subvalues payloads) so the test fails if
the flag is ignored.
Summary by CodeRabbit
--ground-truth-subvaluesCLI parameter covering create operations, update operations with multiple subvalues, and invalid input error handling