Test Coverage, CLAUDE.md, and README Footer#39
Merged
Conversation
Enhance documentation to include detailed descriptions for existing and new Makefile targets, updated build and testing commands, and clarified directory structure for integration and E2E tests.
Add attribution to Craig Johnston and sponsorship acknowledgment for Deasil Works, Inc. at the end of the README.
Extend test coverage with dry-run tests for `RemoveIPs`, `RemoveCIDRs`, and `RemoveByComment`. Add validation tests for CLI commands, including `add`, `remove`, `list`, and `show` commands, and run function tests to ensure correct command behavior.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39 +/- ##
===========================================
+ Coverage 72.48% 88.90% +16.42%
===========================================
Files 15 15
Lines 676 676
===========================================
+ Hits 490 601 +111
+ Misses 165 60 -105
+ Partials 21 15 -6 🚀 New features to boost your workflow:
|
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.
Test Coverage Improvements
Before
txeh.go): 96.8%After
txeh.go): 96.8%What was added (
txeh/cmd/root_test.go)DryRun path tests for commands that were only tested in save mode:
TestRemoveIPs_DryRunTestRemoveIPRanges_DryRunTestRemoveByComment_DryRunVersionFromBuild tests:
TestVersionFromBuild_GoreleaserVersion- covers the goreleaser-set version pathTestVersionFromBuild_Default- covers thedebug.ReadBuildInfo()pathinitEtcHosts tests:
TestInitEtcHosts_DefaultPath- coversNewHostsDefault()path (empty paths + zero max)TestInitEtcHosts_EmptyPathsNonZeroMax- coversNewHostspath with custom maxCobra Args validation tests for all commands:
TestAddCmd_Args_Valid,_TooFew,_InvalidIP,_InvalidHostnameTestRemoveHostCmd_Args_Valid,_Empty,_InvalidHostnameTestRemoveIPCmd_Args_Valid,_Empty,_InvalidIPTestRemoveCidrCmd_Args_Valid,_Empty,_InvalidCIDRTestRemoveCommentCmd_Args_Valid,_EmptyTestListByHostsCmd_Args_Valid,_Empty,_InvalidHostnameTestListByIPCmd_Args_Valid,_Empty,_InvalidIPTestListByCidrCmd_Args_Valid,_Empty,_InvalidCIDRTestListByCommentCmd_Args_Valid,_EmptyTestShowCmd_ArgsCobra Run function tests for all commands:
TestAddCmd_Run_Basic,_WithComment,_NotQuiet,_NotQuiet_WithCommentTestRemoveHostCmd_Run,TestRemoveIPCmd_Run,TestRemoveCidrCmd_Run,TestRemoveCommentCmd_RunTestListByHostsCmd_Run,TestListByIPCmd_Run,TestListByCidrCmd_Run,TestListByCommentCmd_RunTestShowCmd_Run,TestVersionCmd_RunRemaining uncovered code
os.Exit(1)error paths in cmd functions (require process forking to test)Execute()function (cobra wrapper, 0%)main()intxeh/txeh.go(0%, standard for Go CLIs)CLAUDE.md Updates
verify-fulldescription (was incorrectly described as "Run all tests including integration")lint-fix,test-integration,test-e2e,dead-code,check,mutategoreleaser release --snapshot --clean)GNUmakefile,test/integration/,test/e2e/to File Naming Conventions tableREADME.md Footer
Added attribution footer before the link reference definition.