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:
Vaibhav Malik
2024-05-09 11:48:59 +05:30
committed by GitHub
parent 2c7c74472c
commit 63f7fcfef7
2 changed files with 144 additions and 2 deletions

View File

@@ -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)