Skip to content

Commit

Permalink
Merge pull request #3379 from sedefsavas/revert-3343
Browse files Browse the repository at this point in the history
Revert #3343 e2e test changes
  • Loading branch information
k8s-ci-robot committed Apr 4, 2022
2 parents d30bd0f + 14bd478 commit 831a0ab
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 245 deletions.
1 change: 0 additions & 1 deletion test/e2e/data/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,3 @@ intervals:
default/wait-machine-pool-upgrade: [ "50m", "10s" ]
default/wait-create-identity: ["1m", "10s"]
default/wait-job: ["10m", "10s"]
default/wait-create-service: ["60s", "10s"]
1 change: 0 additions & 1 deletion test/e2e/data/e2e_eks_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,3 @@ intervals:
default/wait-control-plane-upgrade: ["35m", "30s"]
default/wait-addon-status: ["10m", "30s"]
default/wait-create-identity: ["1m", "10s"]
default/wait-create-service: ["60s", "10s"]
195 changes: 0 additions & 195 deletions test/e2e/shared/services.go

This file was deleted.

3 changes: 1 addition & 2 deletions test/e2e/suites/managed/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ var _ = ginkgo.Describe("[managed] [general] EKS cluster tests", func() {
AWSSession: e2eCtx.BootstrapUserAWSSession,
Namespace: namespace,
ClusterName: clusterName,
IncludeLBTest: true,
Replicas: 1,
Cleanup: true,
}
Expand All @@ -125,7 +124,6 @@ var _ = ginkgo.Describe("[managed] [general] EKS cluster tests", func() {
AWSSession: e2eCtx.BootstrapUserAWSSession,
Namespace: namespace,
ClusterName: clusterName,
IncludeLBTest: true,
IncludeScaling: true,
Cleanup: true,
}
Expand All @@ -138,6 +136,7 @@ var _ = ginkgo.Describe("[managed] [general] EKS cluster tests", func() {
Name: clusterName,
})
Expect(cluster).NotTo(BeNil(), "couldn't find CAPI cluster")

framework.DeleteCluster(ctx, framework.DeleteClusterInput{
Deleter: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
Cluster: cluster,
Expand Down
23 changes: 5 additions & 18 deletions test/e2e/suites/managed/machine_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ import (
"context"

"github.com/aws/aws-sdk-go/aws/client"
"github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"

"sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
"sigs.k8s.io/cluster-api/util"
)

// MachineDeploymentSpecInput is the input for MachineDeploymentSpec.
Expand All @@ -45,7 +42,6 @@ type MachineDeploymentSpecInput struct {
Namespace *corev1.Namespace
Replicas int64
ClusterName string
IncludeLBTest bool
Cleanup bool
}

Expand Down Expand Up @@ -96,26 +92,17 @@ func MachineDeploymentSpec(ctx context.Context, inputGetter func() MachineDeploy
StatusChecks: statusChecks,
}
framework.WaitForMachineStatusCheck(ctx, machineStatusInput, input.E2EConfig.GetIntervals("", "wait-machine-status")...)
if input.IncludeLBTest {
clusterClient := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName).GetClient()
ginkgo.By("Creating the Nginx deployment")
deploymentName := "test-deployment-" + util.RandomString(6)
shared.CreateDefaultNginxDeployment(metav1.NamespaceDefault, deploymentName, clusterClient)
ginkgo.By("Creating the LB service")
lbServiceName := "test-svc-" + util.RandomString(6)
elbName := shared.CreateLBService(e2eCtx, metav1.NamespaceDefault, lbServiceName, clusterClient)
shared.VerifyElbExists(e2eCtx, elbName, true)
ginkgo.By("Deleting the Nginx deployment")
shared.DeleteDefaultNginxDeployment(metav1.NamespaceDefault, deploymentName, clusterClient)
ginkgo.By("Deleting LB service")
shared.DeleteLBService(metav1.NamespaceDefault, lbServiceName, clusterClient)
}

if input.Cleanup {
deleteMachineDeployment(ctx, deleteMachineDeploymentInput{
Deleter: input.BootstrapClusterProxy.GetClient(),
MachineDeployment: md[0],
})
// deleteMachine(ctx, deleteMachineInput{
// Deleter: input.BootstrapClusterProxy.GetClient(),
// Machine: &workerMachines[0],
// })

waitForMachineDeploymentDeleted(ctx, waitForMachineDeploymentDeletedInput{
Getter: input.BootstrapClusterProxy.GetClient(),
MachineDeployment: md[0],
Expand Down
18 changes: 0 additions & 18 deletions test/e2e/suites/managed/machine_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ import (
"github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"

"sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
"sigs.k8s.io/cluster-api/util"
)

// ManagedMachinePoolSpecInput is the input for ManagedMachinePoolSpec.
Expand All @@ -44,7 +42,6 @@ type ManagedMachinePoolSpecInput struct {
Namespace *corev1.Namespace
ClusterName string
IncludeScaling bool
IncludeLBTest bool
Cleanup bool
}

Expand Down Expand Up @@ -106,21 +103,6 @@ func ManagedMachinePoolSpec(ctx context.Context, inputGetter func() ManagedMachi
})
}

if input.IncludeLBTest {
clusterClient := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName).GetClient()
ginkgo.By("Creating the Nginx deployment")
deploymentName := "test-deployment-" + util.RandomString(6)
shared.CreateDefaultNginxDeployment(metav1.NamespaceDefault, deploymentName, clusterClient)
ginkgo.By("Creating the LB service")
lbServiceName := "test-svc-" + util.RandomString(6)
elbName := shared.CreateLBService(e2eCtx, metav1.NamespaceDefault, lbServiceName, clusterClient)
shared.VerifyElbExists(e2eCtx, elbName, true)
ginkgo.By("Deleting the Nginx deployment")
shared.DeleteDefaultNginxDeployment(metav1.NamespaceDefault, deploymentName, clusterClient)
ginkgo.By("Deleting LB service")
shared.DeleteLBService(metav1.NamespaceDefault, lbServiceName, clusterClient)
}

if input.Cleanup {
deleteMachinePool(ctx, deleteMachinePoolInput{
Deleter: input.BootstrapClusterProxy.GetClient(),
Expand Down
Loading

0 comments on commit 831a0ab

Please sign in to comment.