fix: resolve golangci-lint issues in hetzner-csi installer tests#2092
Merged
devantler merged 2 commits intotest/hetzner-csi-installer-coverage-fc7795ec6ba0032bfrom Feb 7, 2026
Merged
Conversation
- Remove unused error variables - Use assert.AnError for error mocking instead of dynamic errors - Fix errcheck issues by checking os.Unsetenv return value - Use t.Setenv() instead of os.Setenv() for proper test cleanup - Add required whitespace before defer statement - Split TestHetznerCSIInstaller_Images into three separate functions to fix funlen - Use require.ErrorIs instead of assert.ErrorIs for error assertions All tests pass and coverage remains at 44.2% Co-authored-by: devantler <26203420+devantler@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve test coverage for Hetzner CSI installer
fix: resolve golangci-lint issues in hetzner-csi installer tests
Feb 7, 2026
ea286ba
into
test/hetzner-csi-installer-coverage-fc7795ec6ba0032b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 7 linting violations in the Hetzner CSI installer test suite introduced in the coverage improvement PR.
Changes
assert.AnErrorfor mock errors instead oferrors.New()(err113)os.Unsetenv()return value; uset.Setenv()instead of manual cleanup (errcheck, usetesting)TestHetznerCSIInstaller_Imagesinto 3 focused functions (funlen):TestHetznerCSIInstaller_Images_SuccessfulExtractionTestHetznerCSIInstaller_Images_TemplatingFailsTestHetznerCSIInstaller_Images_NoImagesrequire.ErrorIsfor error assertions (testifylint)All tests pass with 44.2% coverage maintained.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.