Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shipyard framework By instead of ginkgo By #1538

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions test/e2e/discovery/headless_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ func RunHeadlessDiscoveryTest(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
f.NewNginxDeployment(framework.ClusterB)

By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))

nginxHeadlessClusterB := f.NewNginxHeadlessService(framework.ClusterB)

f.NewServiceExport(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand Down Expand Up @@ -110,27 +110,27 @@ func RunHeadlessDiscoveryLocalAndRemoteTest(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
f.NewNginxDeployment(framework.ClusterB)
By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))

nginxHeadlessClusterB := f.NewNginxHeadlessService(framework.ClusterB)

f.NewServiceExport(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)
f.AwaitAggregatedServiceImport(framework.ClusterA, nginxHeadlessClusterB, 1)

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
f.NewNginxDeployment(framework.ClusterA)
By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))

nginxHeadlessClusterA := f.NewNginxHeadlessService(framework.ClusterA)

f.NewServiceExport(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)
f.AwaitAggregatedServiceImport(framework.ClusterA, nginxHeadlessClusterA, 2)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand Down Expand Up @@ -166,18 +166,18 @@ func RunHeadlessEndpointDiscoveryTest(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

By(fmt.Sprintf("Creating a Headless Service without selector on %q", clusterBName))
framework.By(fmt.Sprintf("Creating a Headless Service without selector on %q", clusterBName))

headlessClusterB := f.NewHeadlessServiceEndpointIP(framework.ClusterB)

By("Creating an endpoint")
framework.By("Creating an endpoint")
f.NewEndpointForHeadlessService(framework.ClusterB, headlessClusterB)

By("Exporting the service %q")
framework.By("Exporting the service %q")
f.NewServiceExport(framework.ClusterB, headlessClusterB.Name, headlessClusterB.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterB, headlessClusterB.Name, headlessClusterB.Namespace)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand Down Expand Up @@ -205,19 +205,19 @@ func RunHeadlessPodsAvailabilityTest(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
f.NewNginxDeployment(framework.ClusterB)
f.SetNginxReplicaSet(framework.ClusterB, 3)

By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))

nginxHeadlessClusterB := f.NewNginxHeadlessService(framework.ClusterB)

f.NewServiceExport(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)

f.AwaitServiceExportedStatusCondition(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand All @@ -239,19 +239,19 @@ func RunHeadlessPodsAvailabilityTest(f *lhframework.Framework) {
func RunHeadlessPodsAvailabilityTestLocal(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
f.NewNginxDeployment(framework.ClusterA)
f.SetNginxReplicaSet(framework.ClusterA, 3)

By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))

nginxHeadlessClusterA := f.NewNginxHeadlessService(framework.ClusterA)

f.NewServiceExport(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)

f.AwaitServiceExportedStatusCondition(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand All @@ -274,27 +274,27 @@ func RunHeadlessDiscoveryClusterNameTest(f *lhframework.Framework) {
clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterAName))
f.NewNginxDeployment(framework.ClusterA)

By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterAName))

nginxHeadlessClusterA := f.NewNginxHeadlessService(framework.ClusterA)

f.NewServiceExport(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterA, nginxHeadlessClusterA.Name, nginxHeadlessClusterA.Namespace)

By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
framework.By(fmt.Sprintf("Creating an Nginx Deployment on %q", clusterBName))
f.NewNginxDeployment(framework.ClusterB)

By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))
framework.By(fmt.Sprintf("Creating a Nginx Headless Service on %q", clusterBName))

nginxHeadlessClusterB := f.NewNginxHeadlessService(framework.ClusterB)

f.NewServiceExport(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)
f.AwaitServiceExportedStatusCondition(framework.ClusterB, nginxHeadlessClusterB.Name, nginxHeadlessClusterB.Namespace)

By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))
framework.By(fmt.Sprintf("Creating a Netshoot Deployment on %q", clusterAName))

netshootPodList := f.NewNetShootDeployment(framework.ClusterA)

Expand Down Expand Up @@ -332,7 +332,7 @@ func verifyHeadlessSRVRecordsWithDig(f *framework.Framework, cluster framework.C
op += " not"
}

By(fmt.Sprintf("Executing %q to verify hostNames %v for service %q %q discoverable",
framework.By(fmt.Sprintf("Executing %q to verify hostNames %v for service %q %q discoverable",
strings.Join(cmd, " "), hostNameList, service.Name, op))
framework.AwaitUntil(" service IP verification", func() (interface{}, error) {
stdout, _, err := f.ExecWithOptions(context.TODO(), &framework.ExecOptions{
Expand All @@ -349,7 +349,7 @@ func verifyHeadlessSRVRecordsWithDig(f *framework.Framework, cluster framework.C

return stdout, nil
}, func(result interface{}) (bool, string, error) {
By(fmt.Sprintf("Validating that dig result %s %q", op, result))
framework.By(fmt.Sprintf("Validating that dig result %s %q", op, result))

if len(hostNameList) == 0 && result != "" {
return false, fmt.Sprintf("expected execution result %q to be empty", result), nil
Expand Down
Loading
Loading