test: increase test coverage for go-getter downloader to 77.7%#1443
Merged
aknysh merged 3 commits intoupdate-go-getterfrom Sep 3, 2025
Merged
test: increase test coverage for go-getter downloader to 77.7%#1443aknysh merged 3 commits intoupdate-go-getterfrom
aknysh merged 3 commits intoupdate-go-getterfrom
Conversation
- Add comprehensive tests for GetCustom() method covering various scenarios (89.1% coverage) - Add tests for git operations: clone (90.9%), update (86.5%), checkout (100%), fetchSubmodules (100%) - Add tests for findRemoteDefaultBranch() method (100% coverage) - Add tests for CustomGitGetter.Get() method (100% coverage) - Define static errors in errors/errors.go to comply with golangci-lint err113 - Format code with gofumpt - Overall package coverage increased from 46.1% to 77.7% 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## update-go-getter #1443 +/- ##
====================================================
+ Coverage 55.60% 55.91% +0.31%
====================================================
Files 274 274
Lines 28901 28902 +1
====================================================
+ Hits 16070 16161 +91
+ Misses 11032 10945 -87
+ Partials 1799 1796 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aknysh
approved these changes
Sep 3, 2025
aknysh
added a commit
that referenced
this pull request
Sep 3, 2025
* updates * updates * updates * updates * updates * updates * [autofix.ci] apply automated fixes * updates * [autofix.ci] apply automated fixes * updates * updates * updates * updates * test: increase test coverage for go-getter downloader to 77.7% (#1443) * test: increase test coverage for go-getter downloader to 77.7% - Add comprehensive tests for GetCustom() method covering various scenarios (89.1% coverage) - Add tests for git operations: clone (90.9%), update (86.5%), checkout (100%), fetchSubmodules (100%) - Add tests for findRemoteDefaultBranch() method (100% coverage) - Add tests for CustomGitGetter.Get() method (100% coverage) - Define static errors in errors/errors.go to comply with golangci-lint err113 - Format code with gofumpt - Overall package coverage increased from 46.1% to 77.7% 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * [autofix.ci] apply automated fixes * updates --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: aknysh <andriy.knysh@gmail.com> * fix: resolve golangci-lint issues in pkg/downloader (#1445) - Replace deprecated io/ioutil with os.CreateTemp - Add constants for magic numbers (base10, portBitSize, sshKeyFileMode) - Add constants for repeated strings (gitCommand, originRemote, gitArgSeparator) - Create gitOperationParams struct to reduce function arguments - Fix invalid URL construction in tests - Remove unused return values from test helper functions - Fix potential index out of bounds issue - Add #nosec comments for validated subprocess commands - Apply gofumpt formatting Reduces linting issues from 20 to 6 (remaining are complexity warnings) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> Co-authored-by: Claude <noreply@anthropic.com>
osterman
added a commit
that referenced
this pull request
Sep 23, 2025
* updates * updates * updates * updates * updates * updates * [autofix.ci] apply automated fixes * updates * [autofix.ci] apply automated fixes * updates * updates * updates * updates * test: increase test coverage for go-getter downloader to 77.7% (#1443) * test: increase test coverage for go-getter downloader to 77.7% - Add comprehensive tests for GetCustom() method covering various scenarios (89.1% coverage) - Add tests for git operations: clone (90.9%), update (86.5%), checkout (100%), fetchSubmodules (100%) - Add tests for findRemoteDefaultBranch() method (100% coverage) - Add tests for CustomGitGetter.Get() method (100% coverage) - Define static errors in errors/errors.go to comply with golangci-lint err113 - Format code with gofumpt - Overall package coverage increased from 46.1% to 77.7% 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * [autofix.ci] apply automated fixes * updates --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: aknysh <andriy.knysh@gmail.com> * fix: resolve golangci-lint issues in pkg/downloader (#1445) - Replace deprecated io/ioutil with os.CreateTemp - Add constants for magic numbers (base10, portBitSize, sshKeyFileMode) - Add constants for repeated strings (gitCommand, originRemote, gitArgSeparator) - Create gitOperationParams struct to reduce function arguments - Fix invalid URL construction in tests - Remove unused return values from test helper functions - Fix potential index out of bounds issue - Add #nosec comments for validated subprocess commands - Apply gofumpt formatting Reduces linting issues from 20 to 6 (remaining are complexity warnings) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com> Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
Test Coverage Improvements
Before (46.1% total coverage):
GetCustom: 7.3%checkout: 0%clone: 0%update: 0%fetchSubmodules: 0%findRemoteDefaultBranch: 0%CustomGitGetter.Get: 0%After (77.7% total coverage):
GetCustom: 89.1% ✅checkout: 100% ✅clone: 90.9% ✅update: 86.5% ✅fetchSubmodules: 100% ✅findRemoteDefaultBranch: 100% ✅CustomGitGetter.Get: 100% ✅Changes Made
Added comprehensive test suite (
pkg/downloader/get_git_test.go):Enhanced git_getter tests (
pkg/downloader/git_getter_test.go):Code quality improvements:
errors/errors.goto comply with golangci-lint err113 ruleTest Execution
🤖 Generated with Claude Code