mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-04 00:36:33 +00:00
test: added tests for the pkg/integration package (#904)
This commit adds new tests for the `pkg/integration` package. As a result, the code the code coverage of the package has increased from 0% to 100% This also includes a minor adjustment in the error statements of the `Activate` and `Deactive` functions to ensure better understanding of the cause of the error. Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com> Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
@@ -92,7 +92,7 @@ func (*Integration) Activate(name string, namespace string, activeFilters []stri
|
||||
|
||||
if !skipInstall {
|
||||
if err := integrations[name].Deploy(namespace); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to deploy %s integration: %w", name, err)
|
||||
}
|
||||
}
|
||||
mergedFilters := activeFilters
|
||||
@@ -127,7 +127,7 @@ func (*Integration) Deactivate(name string, namespace string) error {
|
||||
}
|
||||
|
||||
if err := integrations[name].UnDeploy(namespace); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to undeploy %s integration: %w", name, err)
|
||||
}
|
||||
|
||||
viper.Set("active_filters", activeFilters)
|
||||
|
Reference in New Issue
Block a user