chore(sdk): rename IsValidTdf tests for clarity#3483
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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. ✨ 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 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the maintainability of the SDK test suite by standardizing the naming convention for tests related to the IsValidTdf function. By aligning these test names, it becomes easier to identify and filter relevant test coverage during development and auditing. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The tests were hidden in the dark, with names that missed the mark. Now clear and bright, they shine in light, a clean and tidy code-base spark. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request renames several test functions in sdk/sdk_test.go to follow a more descriptive naming convention, including updates to TestIsValidTdf_ValidStandardTDF, TestIsValidTdf_CorruptZIP, and TestIsValidTdf_MissingRequiredField. I have no feedback to provide.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Three tests in sdk/sdk_test.go exercise IsValidTdf but were originally named with a TestNew_ prefix, making them hard to discover when grepping for IsValidTdf coverage: TestNew_ShouldValidateStandardTdf → TestIsValidTdf_ValidStandardTDF TestNew_ShouldNotValidateBadStandardTdf → TestIsValidTdf_CorruptZIP TestIsInvalid_MissingRequiredManifestPayloadField → TestIsValidTdf_MissingRequiredField Surfaced during a docs-drift audit while reviewing DSPX-2603. No behavior change; same tests, same assertions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
5fcc97d to
8ad6cda
Compare
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
Summary
Three tests in
sdk/sdk_test.goexerciseIsValidTdfbut were originally named with aTestNew_prefix, making them hard to discover when grepping forIsValidTdfcoverage:TestNew_ShouldValidateStandardTdfTestIsValidTdf_ValidStandardTDFTestNew_ShouldNotValidateBadStandardTdfTestIsValidTdf_CorruptZIPTestIsInvalid_MissingRequiredManifestPayloadFieldTestIsValidTdf_MissingRequiredFieldSurfaced during an audit of
IsValidTdf(sdk/sdk.go:397) — the function was introduced in PR #1188 (Aug 2024) with a "needs tests" note, and tests did land afterwards, but under names that don't reflect what they test.Test plan
go test ./sdk/... -run TestIsValidTdf_ -count=1passesgofumptcleangolangci-lintclean on the changed file (the two pre-existing warnings on lines 47 / 172 about deprecatedWithTokenEndpointare unrelated)No behavior change; same tests, same assertions.
🤖 Generated with Claude Code