test: Add unit tests and automated test workflow for kubeslice-cli core modules#92
Open
gitsofaryan wants to merge 1 commit intokubeslice:masterfrom
Open
test: Add unit tests and automated test workflow for kubeslice-cli core modules#92gitsofaryan wants to merge 1 commit intokubeslice:masterfrom
gitsofaryan wants to merge 1 commit intokubeslice:masterfrom
Conversation
- Implement unit tests for cmd/common.go with 100% coverage - Add comprehensive CLI root command testing - Create slice operations testing with mock scenarios - Implement command utilities and configuration validation tests - Add constants validation testing for Kubernetes resources - Create print utilities testing with Unicode support - Add main package integration tests - Implement GitHub Actions CI/CD pipeline with automated testing This testing framework provides 55 test cases covering critical functionalities for the kubeslice-cli project, supporting the LFX mentorship program requirements. Signed-off-by: Aryan Jain <aryan.jain.csbs22@ggits.net>
Author
|
hi @richiesebastian @priyupadhyay sir, could you please review my MR ; and wanted to know more issues i can made my self completely involved! 🙇🙇 |
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.
Overview
This PR adds comprehensive unit test coverage to the kubeslice-cli project and introduces a GitHub Actions workflow for automated testing and linting. The goal is to improve code reliability, make future development safer, and streamline the review process.
What’s Included
7 new unit test files:
cmd/common_test.go: Covers the mapFromSlice function and global variables, achieving 100% coverage.cmd/root_test.go: Tests CLI root command initialization and basic argument handling.pkg/slice_test.go: Validates slice operations and edge cases.pkg/cmd-util_test.go: Checks command utility functions for correct behavior.pkg/internal/constants_test.go: Ensures constants are defined and used as expected.util/print-util_test.go: Tests print utilities, including formatting and Unicode support.main_test.go: Verifies main package integration and basic CLI execution.1 GitHub Actions workflow (
.github/workflows/test.yml):go vetandgofmt.How to Test
go test ./... -coverto execute all tests and view coverage.Signed-off-by: gitsofaryan