(feat): Improve a bit coverage #18
Merged
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.
This pull request adds comprehensive unit tests for the main command modules of the project, focusing on validating flag parsing, error handling, help output, and configuration loading for the CLI commands. The new tests cover the
run,cleanup, and root command behaviors, as well as the systemd template rendering logic, improving the reliability and maintainability of the CLI tool.Command testing improvements
cmd/run_test.gowith tests for theruncommand, covering required flag validation, flag parsing, and help output scenarios.cmd/cleanup_test.gowith tests for thecleanupcommand, including flag requirements, flag parsing, and help output verification.cmd/root_test.gowith tests for the root command, verifying help output, unknown subcommand handling, persistent flag definitions, and configuration loading from a file.Systemd template validation
pkg/systemd/systemd_test.goto verify that the globalparsedTemplateis initialized and renders expected systemd sections with valid input data.