Skip to content

Commit 7ec4913

Browse files
authored
chore(e2e): fix RDS test (#3668)
* chore(e2e): fix RDS test * fix deployment name * Update config-map.spec.ts * Reorganize and annotate * Update playwright.config.ts
1 parent 4325e40 commit 7ec4913

File tree

5 files changed

+111
-105
lines changed

5 files changed

+111
-105
lines changed

e2e-tests/playwright.config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ export default defineConfig({
7070
testIgnore: [
7171
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
7272
"**/playwright/e2e/**/*-rbac.spec.ts",
73-
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
73+
"**/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts",
7474
"**/playwright/e2e/auth-providers/**/*.spec.ts",
7575
"**/playwright/e2e/plugins/bulk-import.spec.ts",
76-
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
76+
"**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts",
7777
"**/playwright/e2e/configuration-test/config-map.spec.ts",
7878
"**/playwright/e2e/plugins/tekton/tekton.spec.ts",
7979
"**/playwright/e2e/dynamic-home-page-customization.spec.ts",
@@ -86,7 +86,7 @@ export default defineConfig({
8686
testMatch: [
8787
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
8888
"**/playwright/e2e/**/*-rbac.spec.ts",
89-
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
89+
"**/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts",
9090
"**/playwright/e2e/plugins/bulk-import.spec.ts",
9191
"**/playwright/e2e/plugins/quick-start.spec.ts",
9292
"**/playwright/e2e/plugins/scorecard/scorecard.spec.ts",
@@ -97,7 +97,7 @@ export default defineConfig({
9797
testMatch: ["**/playwright/e2e/auth-providers/*.spec.ts"],
9898
testIgnore: [
9999
"**/playwright/e2e/auth-providers/github-happy-path.spec.ts", // temporarily disable
100-
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
100+
"**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts",
101101
"**/playwright/e2e/dynamic-home-page-customization.spec.ts",
102102
],
103103
retries: 1,
@@ -110,14 +110,14 @@ export default defineConfig({
110110
"**/playwright/e2e/smoke-test.spec.ts",
111111
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
112112
"**/playwright/e2e/**/*-rbac.spec.ts",
113-
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
113+
"**/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts",
114114
"**/playwright/e2e/auth-providers/**/*.spec.ts",
115115
"**/playwright/e2e/plugins/bulk-import.spec.ts",
116116
"**/playwright/e2e/plugins/tekton/tekton.spec.ts",
117117
"**/playwright/e2e/scaffolder-backend-module-annotator.spec.ts",
118118
"**/playwright/e2e/plugins/ocm.spec.ts",
119119
"**/playwright/e2e/audit-log/**/*.spec.ts",
120-
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
120+
"**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts",
121121
"**/playwright/e2e/configuration-test/config-map.spec.ts",
122122
"**/playwright/e2e/github-happy-path.spec.ts",
123123
"**/playwright/e2e/dynamic-home-page-customization.spec.ts",
@@ -141,13 +141,13 @@ export default defineConfig({
141141
testIgnore: [
142142
"**/playwright/e2e/plugins/rbac/**/*.spec.ts",
143143
"**/playwright/e2e/**/*-rbac.spec.ts",
144-
"**/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts",
144+
"**/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts",
145145
"**/playwright/e2e/auth-providers/**/*.spec.ts",
146146
"**/playwright/e2e/plugins/bulk-import.spec.ts",
147147
"**/playwright/e2e/plugins/tekton/tekton.spec.ts",
148148
"**/playwright/e2e/scaffolder-backend-module-annotator.spec.ts",
149149
"**/playwright/e2e/audit-log/**/*.spec.ts",
150-
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
150+
"**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts",
151151
"**/playwright/e2e/configuration-test/config-map.spec.ts",
152152
"**/playwright/e2e/github-happy-path.spec.ts",
153153
"**/playwright/e2e/dynamic-home-page-customization.spec.ts",
@@ -169,7 +169,7 @@ export default defineConfig({
169169
dependencies: ["smoke-test"],
170170
testMatch: [
171171
"**/playwright/e2e/configuration-test/config-map.spec.ts",
172-
"**/playwright/e2e/verify-tls-config-health-check.spec.ts",
172+
"**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts",
173173
],
174174
},
175175

e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ import { Common } from "../../utils/common";
44
import { UIhelper } from "../../utils/ui-helper";
55
test.describe("Change app-config at e2e test runtime", () => {
66
test.beforeAll(async () => {
7-
test.info().annotations.push({
8-
type: "component",
9-
description: "configuration",
10-
});
7+
test.info().annotations.push(
8+
{
9+
type: "component",
10+
description: "configuration",
11+
},
12+
{
13+
type: "namespace",
14+
description: process.env.NAME_SPACE_RUNTIME || "showcase-runtime",
15+
},
16+
);
1117
});
1218

1319
// operator nightly does not require this test as RDS tls test also verifies runtime change
@@ -20,7 +26,9 @@ test.describe("Change app-config at e2e test runtime", () => {
2026
const configMapName = "app-config-rhdh";
2127
// eslint-disable-next-line playwright/no-conditional-in-test
2228
const namespace = process.env.NAME_SPACE_RUNTIME || "showcase-runtime";
23-
const deploymentName = "rhdh-developer-hub";
29+
const deploymentName =
30+
// eslint-disable-next-line playwright/no-conditional-in-test
31+
(process.env.RELEASE_NAME || "rhdh") + "-developer-hub";
2432

2533
const kubeUtils = new KubeClient();
2634
const dynamicTitle = generateDynamicTitle();

e2e-tests/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts renamed to e2e-tests/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { test, expect } from "@playwright/test";
2-
import { UIhelper } from "../utils/ui-helper";
3-
import { Common } from "../utils/common";
4-
test.describe("Verify TLS configuration with external Postgres DB", () => {
2+
import { UIhelper } from "../../utils/ui-helper";
3+
import { Common } from "../../utils/common";
4+
test.describe("Verify TLS configuration with external Crunchy Postgres DB", () => {
55
test.beforeAll(async () => {
6-
test.info().annotations.push({
7-
type: "component",
8-
description: "data-management",
9-
});
6+
test.info().annotations.push(
7+
{
8+
type: "component",
9+
description: "data-management",
10+
},
11+
{
12+
type: "namespace",
13+
description: process.env.NAME_SPACE_RBAC || "showcase-rbac",
14+
},
15+
);
1016
});
1117

1218
test("Verify successful DB connection and display of expected entities in the Home Page and Catalog", async ({
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { test } from "@playwright/test";
2+
import { Common } from "../../utils/common";
3+
import { KubeClient } from "../../utils/kube-client";
4+
5+
test.describe
6+
.serial("Verify TLS configuration with Postgres DB health check", () => {
7+
test.beforeAll(async () => {
8+
test.info().annotations.push(
9+
{
10+
type: "component",
11+
description: "data-management",
12+
},
13+
{
14+
type: "namespace",
15+
description: process.env.NAME_SPACE_RUNTIME || "showcase-runtime",
16+
},
17+
);
18+
});
19+
20+
const namespace = process.env.NAME_SPACE_RUNTIME || "showcase-runtime";
21+
const job: string = process.env.JOB_NAME;
22+
let deploymentName = process.env.RELEASE_NAME + "-developer-hub";
23+
if (job.includes("operator")) {
24+
deploymentName = "backstage-" + process.env.RELEASE_NAME;
25+
}
26+
const secretName = "postgres-cred";
27+
const hostLatest2 = Buffer.from(process.env.RDS_2_HOST).toString("base64");
28+
const hostLatest3 = Buffer.from(process.env.RDS_3_HOST).toString("base64");
29+
30+
test("Verify successful DB connection and successful initialization of plugins with latest-1 postgres version", async ({
31+
page,
32+
}) => {
33+
const common = new Common(page);
34+
await common.loginAsGuest();
35+
});
36+
37+
test("Change the config to use the latest-2 postgres version", async () => {
38+
const kubeCLient = new KubeClient();
39+
test.setTimeout(180000);
40+
const secretData = {
41+
POSTGRES_HOST: hostLatest2,
42+
};
43+
const patch = {
44+
data: secretData,
45+
};
46+
await kubeCLient.updateSecret(secretName, namespace, patch);
47+
await kubeCLient.restartDeployment(deploymentName, namespace);
48+
});
49+
50+
test("Verify successful DB connection and successful initialization of plugins with latest-2 postgres version", async ({
51+
page,
52+
}) => {
53+
const common = new Common(page);
54+
await common.loginAsGuest();
55+
});
56+
57+
test("Change the config to use the latest-3 postgres version", async () => {
58+
const kubeCLient = new KubeClient();
59+
test.setTimeout(180000);
60+
const secretData = {
61+
POSTGRES_HOST: hostLatest3,
62+
};
63+
const patch = {
64+
data: secretData,
65+
};
66+
await kubeCLient.updateSecret(secretName, namespace, patch);
67+
await kubeCLient.restartDeployment(deploymentName, namespace);
68+
});
69+
70+
test("Verify successful DB connection and successful initialization of plugins with latest-3 postgres version", async ({
71+
page,
72+
}) => {
73+
const common = new Common(page);
74+
await common.loginAsGuest();
75+
});
76+
});

e2e-tests/playwright/e2e/verify-tls-config-health-check.spec.ts

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)