Skip to content

chore(sdk): rename IsValidTdf tests for clarity#3483

Open
marythought wants to merge 1 commit into
mainfrom
chore/rename-isvalidtdf-tests
Open

chore(sdk): rename IsValidTdf tests for clarity#3483
marythought wants to merge 1 commit into
mainfrom
chore/rename-isvalidtdf-tests

Conversation

@marythought
Copy link
Copy Markdown
Contributor

Summary

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:

Old name New name
TestNew_ShouldValidateStandardTdf TestIsValidTdf_ValidStandardTDF
TestNew_ShouldNotValidateBadStandardTdf TestIsValidTdf_CorruptZIP
TestIsInvalid_MissingRequiredManifestPayloadField TestIsValidTdf_MissingRequiredField

Surfaced 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=1 passes
  • gofumpt clean
  • golangci-lint clean on the changed file (the two pre-existing warnings on lines 47 / 172 about deprecated WithTokenEndpoint are unrelated)

No behavior change; same tests, same assertions.

🤖 Generated with Claude Code

@marythought marythought requested review from a team as code owners May 18, 2026 15:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@marythought has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 29 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 32b8cec6-b51b-4fa6-aa54-d1ac18b4b60d

📥 Commits

Reviewing files that changed from the base of the PR and between eae8645 and 8ad6cda.

📒 Files selected for processing (1)
  • sdk/sdk_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/rename-isvalidtdf-tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added comp:sdk A software development kit, including library, for client applications and inter-service communicati size/xs labels May 18, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Test Renaming: Renamed three test functions in sdk/sdk_test.go to follow the TestIsValidTdf_ prefix convention, improving discoverability and consistency.
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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 136.513377ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 66.954336ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 347.680553ms
Throughput 287.62 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 34.414454332s
Average Latency 342.755114ms
Throughput 145.29 requests/second

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>
@marythought marythought force-pushed the chore/rename-isvalidtdf-tests branch from 5fcc97d to 8ad6cda Compare May 19, 2026 16:26
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 180.889369ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 93.824928ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 436.957667ms
Throughput 228.86 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.731412405s
Average Latency 436.22081ms
Throughput 114.33 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:sdk A software development kit, including library, for client applications and inter-service communicati size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants