Skip to content

Commit

Permalink
chore(e2e): [e2e] Fix and Enable topoloy test case on AKS and GKE (#2215
Browse files Browse the repository at this point in the history
)

* [Test automation] Verify Topology is a supported plugin and E2E scenario follow-up

* Namespace removed

* [Test automation] Verify Topology is a supported plugin and E2E scenario follow-up

* Namespace removed

* [Test automation] Verify Topology is a supported plugin and E2E scenario follow-up

* Namespace removed

* Sleep test

* TLS issue

* pipeline config change

* cleanup

* cleanup

* cleanup

* 1.4 changes

* fix

* Requested changes

* Requested changes

* Adding Ingress resource for k8s

* [Test automation] Verify Topology is a supported plugin and E2E scenario follow-up

* [Test automation] Verify Topology is a supported plugin and E2E scenario follow-up

* Sleep test

* TLS issue

* cleanup

* cleanup

* Requested changes

* Adding Ingress resource for k8s

* Adding Ingress test

* Fixing Ingress test

* Fixing Ingress test

* Testing on AKS

* Testing on AKS fix

* Testing on AKS

* Testing on AKS fix

* Removing AKS test
  • Loading branch information
teknaS47 authored Jan 29, 2025
1 parent b2b34d2 commit 1b09157
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 28 deletions.
19 changes: 19 additions & 0 deletions .ibm/pipelines/resources/topology_test/topology-test-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: topology-test-route
labels:
app: topology-test
backstage.io/kubernetes-id: developer-hub
spec:
rules:
- host: topology-test-route
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: topology-test-service
port:
number: 8080
14 changes: 14 additions & 0 deletions .ibm/pipelines/resources/topology_test/topology-test-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: topology-test-route
labels:
app: topology-test
backstage.io/kubernetes-id: developer-hub
spec:
to:
kind: Service
name: topology-test-service
port:
targetPort: 8080
wildcardPolicy: None
17 changes: 1 addition & 16 deletions .ibm/pipelines/resources/topology_test/topology-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,4 @@ spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: topology-test-route
labels:
app: topology-test
backstage.io/kubernetes-id: developer-hub
spec:
to:
kind: Service
name: topology-test-service
port:
targetPort: 8080
wildcardPolicy: None
targetPort: 8080
7 changes: 5 additions & 2 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,11 @@ apply_yaml_files() {
oc apply -f "$dir/resources/pipeline-run/hello-world-pipeline-run.yaml"

# Create Deployment and Pipeline for Topology test.
if [[ "${project}" != *k8s* ]]; then # Specific to OCP deployments (uses Route which is not supported by K8S)
oc apply -f "$dir/resources/topology_test/topology-test.yaml"
oc apply -f "$dir/resources/topology_test/topology-test.yaml"
if [[ "${project}" == *k8s* ]]; then
oc apply -f "$dir/resources/topology_test/topology-test-ingress.yaml"
else
oc apply -f "$dir/resources/topology_test/topology-test-route.yaml"
fi
}

Expand Down
2 changes: 0 additions & 2 deletions e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,10 @@ export default defineConfig({
"**/playwright/e2e/authProviders/**/*.spec.ts",
"**/playwright/e2e/plugins/bulk-import.spec.ts",
"**/playwright/e2e/plugins/tekton/tekton.spec.ts",
"**/playwright/e2e/plugins/topology/topology.spec.ts", // uses Route (not supported in K8S)
"**/playwright/e2e/catalog-scaffoldedfromLink.spec.ts",
"**/playwright/e2e/plugins/ocm.spec.ts",
"**/playwright/e2e/audit-log/**/*.spec.ts",
"**/playwright/e2e/verify-redis-cache.spec.ts",
"**/playwright/e2e/plugins/topology/topology.spec.ts",
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
"**/playwright/e2e/configuration-test/config-map.spec.ts",
],
Expand Down
26 changes: 18 additions & 8 deletions e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ test.describe("Test Topology Plugin", () => {
await uiHelper.clickTab("Topology");
await uiHelper.verifyText("backstage-janus");
await page.getByRole("button", { name: "Fit to Screen" }).click();
// await uiHelper.verifyText("rhdh");
// await uiHelper.verifyText("rhdh-rbac");
await uiHelper.verifyText("topology-test");
await uiHelper.verifyButtonURL("Open URL", "topology-test-route", {
locator: `[data-test-id="topology-test"]`,
Expand All @@ -38,13 +36,25 @@ test.describe("Test Topology Plugin", () => {
await uiHelper.clickTab("Resources");
await uiHelper.verifyHeading("Pods");
await uiHelper.verifyHeading("Services");
await uiHelper.verifyHeading("Routes");
await expect(
page.getByRole("link", { name: "topology-test-route" }),
).toBeVisible();
if (await page.getByText("Ingresses").isVisible()) {
await uiHelper.verifyHeading("Ingresses");
await uiHelper.verifyText("I");
await expect(
page
.getByTestId("ingress-list")
.getByRole("link", { name: "topology-test-route" }),
).toBeVisible();
await expect(page.locator("pre")).toBeVisible();
} else {
await uiHelper.verifyHeading("Routes");
await uiHelper.verifyText("RT");
await expect(
page.getByRole("link", { name: "topology-test-route" }).first(),
).toBeVisible();
}
await uiHelper.verifyText("Location:");
await expect(page.getByTitle("Deployment")).toBeVisible();
await uiHelper.verifyText("S");
await uiHelper.verifyText("RT");
await expect(page.locator("rect").first()).toBeVisible();
await uiHelper.clickTab("Details");
await page.getByLabel("Pod").hover();
Expand Down Expand Up @@ -75,6 +85,6 @@ test.describe("Test Topology Plugin", () => {
await uiHelper.verifyText("PLR");
await page.getByTestId("status-ok").first().click();
await uiHelper.verifyDivHasText("Pipeline SucceededTask");
await uiHelper.verifyText("2 Succeeded");
await uiHelper.verifyText("Pipeline Succeeded");
});
});

0 comments on commit 1b09157

Please sign in to comment.