Skip to content

Commit 253f84d

Browse files
committed
consolidate orchestrator e2e branch history
Squash prior iterative commits into one clean commit while preserving final orchestrator e2e behavior and test updates.
1 parent f3d542f commit 253f84d

15 files changed

Lines changed: 5506 additions & 3 deletions

run-e2e.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,20 @@ for ws in "${E2E_WORKSPACES[@]}"; do
194194
WS_DIR="workspaces/${ws}/e2e-tests"
195195
WS_CONFIG="${WS_DIR}/playwright.config.ts"
196196

197-
# Extract content between "projects: [" and "]," (the project objects)
198-
PROJECTS_BLOCK=$(sed -n '/projects: \[/,/^\s*\],/{ /projects: \[/d; /^\s*\],/d; p; }' "$WS_CONFIG")
197+
# Extract content between "projects: [" and its matching "]".
198+
# Uses awk with bracket-depth tracking so nested arrays (e.g. testMatch: [...])
199+
# don't prematurely terminate the extraction.
200+
PROJECTS_BLOCK=$(awk '
201+
/projects:[[:space:]]*\[/ { inside=1; depth=1; next }
202+
inside {
203+
for (i=1; i<=length($0); i++) {
204+
c = substr($0, i, 1)
205+
if (c == "[") depth++
206+
if (c == "]") { depth--; if (depth == 0) { inside=0; next } }
207+
}
208+
if (inside) print
209+
}
210+
' "$WS_CONFIG")
199211

200212
if [[ -z "$PROJECTS_BLOCK" ]]; then
201213
echo "[WARN] No projects found in $WS_CONFIG, skipping"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+
npmRegistryServer: https://registry.npmjs.org
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createEslintConfig } from "@red-hat-developer-hub/e2e-test-utils/eslint";
2+
3+
export default createEslintConfig(import.meta.dirname);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "orchestrator-e2e-tests",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": ">=22",
8+
"yarn": ">=3"
9+
},
10+
"packageManager": "yarn@3.8.7",
11+
"description": "E2E tests for Orchestrator plugin",
12+
"scripts": {
13+
"test": "playwright test",
14+
"report": "playwright show-report",
15+
"test:ui": "playwright test --ui",
16+
"test:headed": "playwright test --headed",
17+
"lint:check": "eslint .",
18+
"lint:fix": "eslint . --fix",
19+
"prettier:check": "prettier --check .",
20+
"prettier:fix": "prettier --write .",
21+
"tsc:check": "tsc --noEmit",
22+
"check": "yarn tsc:check && yarn lint:check && yarn prettier:check"
23+
},
24+
"devDependencies": {
25+
"@eslint/js": "^9.39.2",
26+
"@playwright/test": "1.57.0",
27+
"@types/node": "^24.10.1",
28+
"dotenv": "^16.4.7",
29+
"eslint": "^9.39.2",
30+
"eslint-plugin-check-file": "^3.3.1",
31+
"eslint-plugin-playwright": "^2.4.0",
32+
"prettier": "^3.7.4",
33+
"typescript": "^5.9.3",
34+
"typescript-eslint": "^8.50.0"
35+
},
36+
"dependencies": {
37+
"@red-hat-developer-hub/e2e-test-utils": "redhat-developer/rhdh-e2e-test-utils#main"
38+
}
39+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineConfig } from "@red-hat-developer-hub/e2e-test-utils/playwright-config";
2+
import dotenv from "dotenv";
3+
4+
dotenv.config({ path: `${import.meta.dirname}/.env` });
5+
/**
6+
* Orchestrator plugin e2e test configuration.
7+
* Extends the base config from rhdh-e2e-test-utils.
8+
*/
9+
export default defineConfig({
10+
projects: [
11+
{
12+
name: "orchestrator",
13+
testMatch: ["specs/orchestrator.spec.ts"],
14+
},
15+
],
16+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# rhdh app config file
2+
# this file is used to merge with the default values of the rhdh app config
3+
4+
app:
5+
title: RHDH Orchestrator Test Instance
6+
backend:
7+
reading:
8+
allow:
9+
- host: github.com
10+
permission:
11+
enabled: true
12+
rbac:
13+
pluginsWithPermission:
14+
- orchestrator
15+
admin:
16+
users:
17+
- name: user:default/test1
18+
orchestrator:
19+
dataIndexService:
20+
url: ${SONATAFLOW_DATA_INDEX_URL}
21+
catalog:
22+
rules:
23+
- allow: [Template, Component, System, Group, Resource, Location, API, User]
24+
locations:
25+
- type: url
26+
target: https://github.com/testetson22/greeting_54mjks/blob/main/templates/greeting/greeting.yaml
27+
- type: url
28+
target: https://github.com/testetson22/greeting_54mjks/blob/main/templates/greeting/greeting_w_component.yaml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: rhdh-secrets
5+
type: Opaque
6+
stringData:
7+
SONATAFLOW_DATA_INDEX_URL: $SONATAFLOW_DATA_INDEX_URL
8+
LOKI_BASE_URL: http://localhost:3100
9+
# Required by orchestrator-backend-module-loki at startup; e2e does not deploy Loki.
10+
LOKI_TOKEN: e2e-ci-placeholder

0 commit comments

Comments
 (0)