chore: Fixing broken tests

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
Alex Jones
2023-04-11 12:42:02 +01:00
parent 55dda432ab
commit c809af3f47
6 changed files with 19 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ import (
"strings"
"testing"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
"github.com/magiconair/properties/assert"
appsv1 "k8s.io/api/apps/v1"
@@ -23,7 +24,7 @@ func TestHPAAnalyzer(t *testing.T) {
},
})
hpaAnalyzer := HpaAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -55,7 +56,7 @@ func TestHPAAnalyzerWithMultipleHPA(t *testing.T) {
},
)
hpaAnalyzer := HpaAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -86,7 +87,7 @@ func TestHPAAnalyzerWithUnsuportedScaleTargetRef(t *testing.T) {
})
hpaAnalyzer := HpaAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -133,7 +134,7 @@ func TestHPAAnalyzerWithNonExistentScaleTargetRef(t *testing.T) {
})
hpaAnalyzer := HpaAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -188,7 +189,7 @@ func TestHPAAnalyzerWithExistingScaleTargetRef(t *testing.T) {
)
hpaAnalyzer := HpaAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},

View File

@@ -5,6 +5,7 @@ import (
"strings"
"testing"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
"github.com/magiconair/properties/assert"
networkingv1 "k8s.io/api/networking/v1"
@@ -23,7 +24,7 @@ func TestIngressAnalyzer(t *testing.T) {
})
ingressAnalyzer := IngressAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -56,7 +57,7 @@ func TestIngressAnalyzerWithMultipleIngresses(t *testing.T) {
)
ingressAnalyzer := IngressAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -83,7 +84,7 @@ func TestIngressAnalyzerWithoutIngressClassAnnotation(t *testing.T) {
})
ingressAnalyzer := IngressAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},

View File

@@ -4,6 +4,7 @@ import (
"context"
"testing"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
"github.com/magiconair/properties/assert"
v1 "k8s.io/api/core/v1"
@@ -31,7 +32,7 @@ func TestPodAnalyzer(t *testing.T) {
},
})
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -39,7 +40,7 @@ func TestPodAnalyzer(t *testing.T) {
Namespace: "default",
}
podAnalyzer := PodAnalyzer{}
var analysisResults []Result
var analysisResults []common.Result
analysisResults, err := podAnalyzer.Analyze(config)
if err != nil {
t.Error(err)

View File

@@ -4,6 +4,7 @@ import (
"context"
"testing"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
"github.com/magiconair/properties/assert"
v1 "k8s.io/api/core/v1"
@@ -32,7 +33,7 @@ func TestServiceAnalyzer(t *testing.T) {
},
}})
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},

View File

@@ -4,6 +4,7 @@ import (
"context"
"testing"
"github.com/k8sgpt-ai/k8sgpt/pkg/common"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
"github.com/magiconair/properties/assert"
appsv1 "k8s.io/api/apps/v1"
@@ -23,7 +24,7 @@ func TestStatefulSetAnalyzer(t *testing.T) {
})
statefulSetAnalyzer := StatefulSetAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -50,7 +51,7 @@ func TestStatefulSetAnalyzerWithoutService(t *testing.T) {
})
statefulSetAnalyzer := StatefulSetAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},
@@ -115,7 +116,7 @@ func TestStatefulSetAnalyzerMissingStorageClass(t *testing.T) {
})
statefulSetAnalyzer := StatefulSetAnalyzer{}
config := Analyzer{
config := common.Analyzer{
Client: &kubernetes.Client{
Client: clientset,
},

View File

@@ -23,10 +23,6 @@ type IIntegration interface {
type Integration struct {
}
type IntegrationProvider struct {
Active []string `mapstructure:"active"`
}
var integrations = map[string]IIntegration{
"trivy": trivy.NewTrivy(),
}