Skip to content

Commit

Permalink
removed duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
cxbrowne1207 committed Feb 22, 2023
1 parent 4ba2fd8 commit f006e08
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions pkg/cluster/cloudstack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (

. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/aws/eks-anywhere/internal/test"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/controller/clientutil"
)

func TestParseConfigMissingCloudstackDatacenter(t *testing.T) {
Expand All @@ -37,12 +36,8 @@ func TestDefaultConfigClientBuilderBuildCloudStackClusterSuccess(t *testing.T) {
},
}

client := fake.NewClientBuilder().WithObjects().Build()
_, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster)
g.Expect(err).To(MatchError(ContainSubstring("building Config from a cluster client")))

client = fake.NewClientBuilder().WithObjects(datacenter).Build()
config, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster)
client := test.NewFakeKubeClient(datacenter)
config, err := b.Build(ctx, client, cluster)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(config).NotTo(BeNil())
g.Expect(config.Cluster).To(Equal(cluster))
Expand All @@ -54,8 +49,8 @@ func TestDefaultConfigClientBuilderBuildCloudStackClusterFailure(t *testing.T) {
ctx := context.Background()
b := cluster.NewDefaultConfigClientBuilder()
cluster := cloudStackCluster()
client := fake.NewClientBuilder().WithObjects().Build()
_, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster)
client := test.NewFakeKubeClient()
_, err := b.Build(ctx, client, cluster)
g.Expect(err).To(MatchError(ContainSubstring("cloudstackdatacenterconfigs.anywhere.eks.amazonaws.com \"datacenter\" not found")))
}

Expand Down

0 comments on commit f006e08

Please sign in to comment.