-
Notifications
You must be signed in to change notification settings - Fork 22
test: replace context.TODO() in tests #1314
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: Tomas Turek <[email protected]>
Reviewer's GuideThis PR refactors the test suite to use proper test-scoped contexts and Gomega instances, ensuring consistent context propagation across all tests and updating verify helper signatures and Ginkgo specs accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider calling t.Parallel() at the top of your individual TestXxx functions to allow tests to run concurrently and speed up the suite.
- There’s a lot of repeated boilerplate initializing
g := NewWithT(t)
andctx := t.Context()
; you could extract that into a small helper or test setup function to reduce duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider calling t.Parallel() at the top of your individual TestXxx functions to allow tests to run concurrently and speed up the suite.
- There’s a lot of repeated boilerplate initializing `g := NewWithT(t)` and `ctx := t.Context()`; you could extract that into a small helper or test setup function to reduce duplication.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Explore these optional code suggestions:
|
PR Type
Tests
Description
Replace context.TODO() with t.Context() in test files
Update test function signatures to use SpecContext
Add EnforceDefaultTimeoutsWhenUsingContexts() to test suites
Modernize Gomega usage patterns in tests
Diagram Walkthrough
File Walkthrough
48 files
Replace context.TODO() with t.Context() in sharding config tests
Replace context.TODO() with t.Context() in database secret tests
Modernize context usage and Gomega patterns in deployment tests
Replace context.TODO() with t.Context() in certificate generation
tests
Replace context.TODO() with t.Context() in server config tests
Replace context.TODO() with t.Context() in key resolution tests
Replace context.TODO() with t.Context() in signer generation tests
Modernize context usage and Gomega patterns in role binding tests
Modernize context usage and Gomega patterns in role tests
Update test function signatures to use SpecContext
Modernize context usage and Gomega patterns in ingress tests
Replace context.TODO() with t.Context() in CTlog server config tests
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Modernize context usage and Gomega patterns in config map tests
Modernize context usage and Gomega patterns in secret tests
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Update test function signatures to use SpecContext
Modernize context usage and Gomega patterns in service tests
Replace context.TODO() with t.Context() in TSA test utilities
Modernize context usage and Gomega patterns in TLS tests
Replace context.TODO() with t.Context() in public key resolution tests
Replace context.TODO() with t.Context() in log signer TLS tests
Replace context.TODO() with t.Context() in log server TLS tests
Replace context.TODO() with t.Context() in CTlog key handling tests
Replace context.TODO() with t.Context() in Fulcio root handling tests
Replace context.TODO() with t.Context() in Fulcio ingress tests
Replace context.TODO() with t.Context() in Rekor server ingress tests
Replace context.TODO() with t.Context() in TSA ingress tests
Replace context.TODO() with t.Context() in TUF ingress tests
Replace context.TODO() with t.Context() in Rekor UI ingress tests
Replace context.TODO() with context.Background() in test suite
Replace context.TODO() with t.Context() in TSA signer generation tests
Replace context.TODO() with ctx in Rekor attestation tests
Replace context.TODO() with t.Context() in RBAC action tests
Replace context.TODO() with t.Context() in tree action tests
Replace context.TODO() with t.Context() in NTP monitoring tests
Add EnforceDefaultTimeoutsWhenUsingContexts to CTlog test suite
Add EnforceDefaultTimeoutsWhenUsingContexts to Fulcio test suite
Add EnforceDefaultTimeoutsWhenUsingContexts to Rekor test suite
Add EnforceDefaultTimeoutsWhenUsingContexts to Trillian test suite
Add EnforceDefaultTimeoutsWhenUsingContexts to TSA test suite
Add EnforceDefaultTimeoutsWhenUsingContexts to TUF test suite