Skip to content

Increase test coverage and refactor parseParameters to ParseParams struct#55

Merged
ullbergm merged 4 commits intomainfrom
add-more-test-coverage
Nov 15, 2025
Merged

Increase test coverage and refactor parseParameters to ParseParams struct#55
ullbergm merged 4 commits intomainfrom
add-more-test-coverage

Conversation

@ullbergm
Copy link
Copy Markdown
Owner

This pull request increases test coverage across the repository and refactors command-line parsing for easier testing.

Key changes:

  • Refactor parseParameters to return a ParseParams struct instead of a long tuple, making the code more maintainable and test-friendly.
  • Add unit tests for parse flags and environment fallbacks, including leader election parsing.
  • Add tests for buildManagerOptions, newLeaseWatcher, and other controller helper functions.
  • Improve various tests across pkg/controllers, pkg/util to raise coverage.

Notes:

  • Backwards incompatible changes are limited to internal function signatures; top-level main continues to use parseLeaderElectionConfig to validate leader election.
  • All tests pass locally and make test completed successfully.

Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
@github-actions github-actions Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/source Changes to the source. labels Nov 15, 2025
@ullbergm ullbergm added the enhancement Enhancement of the code, not introducing new features. label Nov 15, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 15, 2025

Codecov Report

❌ Patch coverage is 43.29897% with 55 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cmd/main.go 43.29% 53 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
@ullbergm ullbergm merged commit ec7e6d9 into main Nov 15, 2025
6 of 7 checks passed
@ullbergm ullbergm deleted the add-more-test-coverage branch November 15, 2025 05:59
@github-actions
Copy link
Copy Markdown

Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/source Changes to the source. enhancement Enhancement of the code, not introducing new features. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant