Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

3mbe
Copy link
Contributor

@3mbe 3mbe commented Aug 21, 2025

What’s Changed

  • Added GoDoc-style comments to internal/k8s for clarity and consistency
  • Added unit tests for ConvertConfig and executorAdapter (covering delegation, error propagation, immutability, nil-config behavior)
  • Added lightweight benchmarks to track performance regressions

Why

  • Improves readability and contributor onboarding
  • Increases test coverage for critical adapter logic
  • Provides a baseline for detecting regressions over time

Closes #172

@3mbe 3mbe force-pushed the internal-k8s-docs branch 3 times, most recently from f400351 to 928b24f Compare August 21, 2025 02:06
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0f6c023). Learn more about missing BASE report.
⚠️ Report is 106 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

t.Parallel()
// Zero-value config should be accepted (no panic).
in := &config.ConfigData{}
_ = ConvertConfig(in)
Copy link
Member

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.

Copy link
Contributor Author

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.


// BenchmarkExecutorAdapter measures adapter overhead to ensure delegation
// stays cheap and doesn’t become a bottleneck as layers evolve.
func BenchmarkExecutorAdapter(b *testing.B) {
Copy link
Member

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.

Copy link
Contributor Author

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.

@3mbe 3mbe force-pushed the internal-k8s-docs branch from 928b24f to c16ccf4 Compare August 21, 2025 15:59
@feiskyer feiskyer merged commit cbd5f90 into Azure:main Aug 22, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GoDoc comments and unit tests for internal/k8s

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.