-
Notifications
You must be signed in to change notification settings - Fork 18
docs/tests: add GoDoc comments and unit tests for k8s adapter #173
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
Conversation
f400351
to
928b24f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #173 +/- ##
=======================================
Coverage ? 35.41%
=======================================
Files ? 61
Lines ? 6272
Branches ? 0
=======================================
Hits ? 2221
Misses ? 3956
Partials ? 95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
internal/k8s/adapter_test.go
Outdated
t.Parallel() | ||
// Zero-value config should be accepted (no panic). | ||
in := &config.ConfigData{} | ||
_ = ConvertConfig(in) |
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.
Thanks for enriching the comments and unit tests.
For tests like _ = ConvertConfig(in)
, could you add some more validation steps to check the converted value? orelse, it won't really test anything as the result is ignored.
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 @feiskyer
Thanks for the review and the teaching lesson! I updated the tests so they now validate the ConvertConfig(in)
results instead of discarding them, and added a package-level var in the benchmark to guard against DCE.
internal/k8s/adapter_test.go
Outdated
|
||
// BenchmarkExecutorAdapter measures adapter overhead to ensure delegation | ||
// stays cheap and doesn’t become a bottleneck as layers evolve. | ||
func BenchmarkExecutorAdapter(b *testing.B) { |
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.
we probably don't need this? The logic is a straightforward configuration data conversion with no additional overhead.
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.
Yeah makes sense. This one’s basically just returning the config and handing off to the executor, so nothing to optimize or profile. Adding the benchmark doesn’t really buy us much here.
928b24f
to
c16ccf4
Compare
What’s Changed
Why
Closes #172