Skip to content

Commit e70fc77

Browse files
committed
chore(tech-radar): add new frontend system e2e test
This change adds an additional test project that runs RHDH with app-next instead of app to test the plugin in the new frontend system. Assisted-by: Cursor
1 parent 8b940ca commit e70fc77

5 files changed

Lines changed: 42 additions & 5 deletions

File tree

workspaces/tech-radar/e2e-tests/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ export default defineConfig({
1111
{
1212
name: "tech-radar",
1313
},
14+
{
15+
name: "tech-radar-app-next",
16+
},
1417
],
1518
});

workspaces/tech-radar/e2e-tests/tests/config/rhdh-secrets.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@ metadata:
44
name: rhdh-secrets
55
type: Opaque
66
stringData:
7+
RHDH_BASE_URL: $RHDH_BASE_URL
8+
KEYCLOAK_BASE_URL: $KEYCLOAK_BASE_URL
9+
KEYCLOAK_METADATA_URL: $KEYCLOAK_METADATA_URL
10+
KEYCLOAK_CLIENT_ID: $KEYCLOAK_CLIENT_ID
11+
KEYCLOAK_CLIENT_SECRET: $KEYCLOAK_CLIENT_SECRET
12+
KEYCLOAK_REALM: $KEYCLOAK_REALM
13+
KEYCLOAK_LOGIN_REALM: $KEYCLOAK_LOGIN_REALM
714
TECH_RADAR_DATA_URL: $TECH_RADAR_DATA_URL
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
upstream:
2+
backstage:
3+
extraAppConfig:
4+
- configMapRef: app-config-rhdh
5+
filename: app-config-rhdh.yaml
6+
extraEnvVarsSecrets:
7+
- rhdh-secrets
8+
extraEnvVars:
9+
- name: APP_CONFIG_app_packageName
10+
value: "app-next"
11+
- name: ENABLE_STANDARD_MODULE_FEDERATION
12+
value: "true"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
upstream:
2+
backstage:
3+
extraAppConfig:
4+
- configMapRef: app-config-rhdh
5+
filename: app-config-rhdh.yaml
6+
extraEnvVarsSecrets:
7+
- rhdh-secrets

workspaces/tech-radar/e2e-tests/tests/specs/tech-radar.spec.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@ import { test, expect, Page } from "rhdh-e2e-test-utils/test";
22
import { $ } from "rhdh-e2e-test-utils/utils";
33
import path from "path";
44

5-
const setupScript = path.join(
6-
import.meta.dirname,
7-
"deploy-customization-provider.sh",
8-
);
5+
const specsDir = import.meta.dirname;
6+
const configDir = path.join(specsDir, "..", "config");
7+
const setupScript = path.join(specsDir, "deploy-customization-provider.sh");
8+
9+
// Resolve value file path once so it works regardless of process.cwd() (e.g. in CI).
10+
const valueFileAppNext = path.resolve(configDir, "value-file-app-next.yaml");
911

1012
test.describe("Test tech-radar plugin", () => {
1113
test.beforeAll(async ({ rhdh }) => {
1214
const project = rhdh.deploymentConfig.namespace;
13-
await rhdh.configure({ auth: "keycloak" });
15+
const useNewFrontend = project === "tech-radar-app-next";
16+
await rhdh.configure({
17+
auth: "keycloak",
18+
...(useNewFrontend && {
19+
valueFile: valueFileAppNext,
20+
}),
21+
});
1422
await $`bash ${setupScript} ${project}`;
1523
process.env.TECH_RADAR_DATA_URL = (
1624
await rhdh.k8sClient.getRouteLocation(

0 commit comments

Comments
 (0)