test(): Add dependency injection infrastructure for comprehensive unit testing#112
Open
Alokxk wants to merge 29 commits intokubeslice:masterfrom
Open
test(): Add dependency injection infrastructure for comprehensive unit testing#112Alokxk wants to merge 29 commits intokubeslice:masterfrom
Alokxk wants to merge 29 commits intokubeslice:masterfrom
Conversation
…epo-add.go file Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
…etion & configuration generation Signed-off-by: Alokzh <zhalok24@gmail.com>
…gathering Signed-off-by: Alokzh <zhalok24@gmail.com>
Contributor
Author
|
This PR started as dependency injection setup but evolved with addition of tests for the Test Files Added:
NOTE: Overall Coverage increased by 64.6% |
…verification Signed-off-by: Alokzh <zhalok24@gmail.com>
…rification Signed-off-by: Alokzh <zhalok24@gmail.com>
…ion & kubeconfig management Signed-off-by: Alokzh <zhalok24@gmail.com>
…nagement functions Signed-off-by: Alokzh <zhalok24@gmail.com>
… construction & added tests Signed-off-by: Alokzh <zhalok24@gmail.com>
… Prometheus Signed-off-by: Alokzh <zhalok24@gmail.com>
…nctions Signed-off-by: Alokzh <zhalok24@gmail.com>
…ry creation & file writing scenarios Signed-off-by: Alokzh <zhalok24@gmail.com>
…ation functions Signed-off-by: Alokzh <zhalok24@gmail.com>
…tions Signed-off-by: Alokzh <zhalok24@gmail.com>
…on, uninstallation & secret fetching Signed-off-by: Alokzh <zhalok24@gmail.com>
…add_integration_test.go Signed-off-by: Alokzh <zhalok24@gmail.com>
…s for verify-executables.go Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
…es for common functions Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Signed-off-by: Alokzh <zhalok24@gmail.com>
Contributor
Author
|
This PR has been updated to include a comprehensive Integration Test suite. While the Unit Tests mock dependencies, these new tests verify the public API against real-world binaries ( Integration Test Files Added:
|
Signed-off-by: Alokzh <zhalok24@gmail.com>
Contributor
Author
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.

Description
This PR introduces a testing infrastructure that makes the CLI testable without requiring external dependencies like helm, kubectl or actual filesystem operations.
Changes
Implemented dependency injection using interfaces to abstract external interactions. Now all system calls (commands, files, output, time) go through mockable interfaces.
interfaces.go- Defines interfaces (Executor, FileOperations, OutputWriter, Clock)exec.go- Real implementations using actual system callstesting.go- Test doubles (fakes) that can be controlled in testsHow Has This Been Tested?
Checklist:
Does this PR introduce a breaking change?