test: improve appconfig.go coverage#6
Merged
github-actions[bot] merged 1 commit intomainfrom May 5, 2026
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR adds targeted unit tests to increase coverage for appconfig.go, focusing on previously untested success paths and error paths (missing external commands, command failures, and filesystem permission/creation failures).
Changes:
- Added tests for writing/clearing curl and wget proxy config files (
.curlrc,.wgetrc). - Added tests for pip config writing and error handling (including directory creation failures).
- Added tests for “command not found” and command failure paths for git and npm, plus read-permission error paths for shared file helpers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+596
to
+603
| func TestEditKeyValueFileReadError(t *testing.T) { | ||
| if runtime.GOOS == "windows" { | ||
| t.Skip("permission bits not enforced the same way on Windows") | ||
| } | ||
| path := filepath.Join(t.TempDir(), "conf") | ||
| if err := os.WriteFile(path, []byte("key = val\n"), 0o000); err != nil { | ||
| t.Fatal(err) | ||
| } |
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.
Adds missing test cases for
appconfig.go— curl, wget, pip, npm not-found paths, git https.proxy failure, file permission error paths. Coverage on main package.