Skip to content

Commit cb97d58

Browse files
HusneShabbirHusneShabbircursoragent
authored
Backport lightspeed e2e tests setup to release-1.10 (#2567)
* test(lightspeed): add consolidated Playwright e2e suite with OpenAI GPT Add lightspeed workspace e2e tests covering display modes, the Lightspeed page, conversation flows, and chat management in a single serial spec with one Keycloak login. Wire OpenAI via Vault secrets, patch allowed_models after deploy, and reuse shared chat setup helpers for stable local and CI runs. Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(lightspeed): polish e2e helpers and local deploy defaults Rename sidebar helpers for clarity, simplify menu assertions with loops, use a single $ import from e2e-test-utils, and default RHDH_VERSION to 1.11. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(lightspeed): avoid duplicate Lightspeed plugin in nightly e2e Use an empty dynamic-plugins config in nightly mode so deploy relies on catalog defaults instead of auto-generating Lightspeed from metadata again. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(lightspeed): upgrade e2e-test-utils to latest Bump @red-hat-developer-hub/e2e-test-utils to 1.1.45 so the Lightspeed e2e workspace uses the latest deployment and nightly plugin metadata behavior. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(lightspeed): use exact match for model menu selection Make chat model selection target an exact menuitem name to avoid partial matches when model labels share prefixes. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: HusneShabbir <husneshabbir447@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5d9595b commit cb97d58

22 files changed

Lines changed: 3714 additions & 4 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
playwright-report/
2+
test-results/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
5+
nodeLinker: node-modules
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { createEslintConfig } from "@red-hat-developer-hub/e2e-test-utils/eslint";
2+
3+
export default [
4+
...createEslintConfig(import.meta.dirname),
5+
{
6+
files: ["**/*.spec.ts"],
7+
rules: {
8+
"playwright/expect-expect": [
9+
"warn",
10+
{
11+
assertFunctionNames: [
12+
"assertChatDialogInitialState",
13+
"assertDrawerState",
14+
"assertVisibilityState",
15+
"expectChatInputAreaVisible",
16+
"expectChatbotControlsVisible",
17+
"expectConversationArea",
18+
"expectEmptyChatHistory",
19+
"expectRhdhContentVisible",
20+
"uploadAndAssertDuplicate",
21+
"validateFailedUpload",
22+
"verifyDisplayModeMenuOptions",
23+
"verifyChatContextMenuOptions",
24+
"verifyConversationsSortedAlphabetically",
25+
"verifyDeleteConfirmation",
26+
"verifyDisablePinnedChatsOption",
27+
"verifyEmptyPinnedChatsMessage",
28+
"verifyEmptySearchResults",
29+
"verifyEnablePinnedChatsOption",
30+
"verifyFeedbackButtons",
31+
"verifyRenameChatForm",
32+
"verifySidePanelConversation",
33+
"verifySortDropdownOptions",
34+
],
35+
},
36+
],
37+
},
38+
},
39+
];
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "lightspeed-e2e-tests",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": ">=24",
8+
"yarn": ">=3"
9+
},
10+
"packageManager": "yarn@4.12.0",
11+
"description": "E2E tests for Lightspeed plugin",
12+
"scripts": {
13+
"test": "playwright test",
14+
"test:serial": "playwright test --workers=1",
15+
"test:ui": "playwright test --ui",
16+
"test:ui:serial": "playwright test --ui --workers=1",
17+
"test:headed": "playwright test --headed",
18+
"test:vault": "VAULT=1 playwright test",
19+
"report": "playwright show-report",
20+
"lint:check": "eslint .",
21+
"lint:fix": "eslint . --fix",
22+
"prettier:check": "prettier --check .",
23+
"prettier:fix": "prettier --write .",
24+
"tsc:check": "tsc --noEmit",
25+
"check": "yarn tsc:check && yarn lint:check && yarn prettier:check"
26+
},
27+
"devDependencies": {
28+
"@eslint/js": "10.0.1",
29+
"@playwright/test": "1.59.1",
30+
"@red-hat-developer-hub/e2e-test-utils": "^1.1.45",
31+
"@types/node": "25.5.2",
32+
"eslint": "10.2.0",
33+
"eslint-plugin-check-file": "3.3.1",
34+
"eslint-plugin-playwright": "2.10.1",
35+
"prettier": "3.8.1",
36+
"typescript": "6.0.2",
37+
"typescript-eslint": "8.58.1"
38+
}
39+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from "@red-hat-developer-hub/e2e-test-utils/playwright-config";
2+
3+
/** Single project: UI + conversation tests share one RHDH namespace (`lightspeed`). */
4+
export default defineConfig({
5+
projects: [
6+
{
7+
name: "lightspeed",
8+
testMatch: "lightspeed.spec.ts",
9+
timeout: 5 * 60 * 1000,
10+
},
11+
],
12+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# RHDH app config merged at deploy. Do not use legacy lightspeed.servers (Road-Core era).
2+
# LCS + Llama Stack run as the lightspeed-core sidecar when global.lightspeed.enabled is true.
3+
4+
permission:
5+
enabled: true
6+
rbac:
7+
pluginsWithPermission:
8+
- catalog
9+
- permission
10+
- lightspeed
11+
admin:
12+
superUsers:
13+
- name: user:default/test1
14+
15+
backend:
16+
csp:
17+
upgrade-insecure-requests: false
18+
img-src:
19+
- "'self'"
20+
- "data:"
21+
- https://avatars.githubusercontent.com
22+
- https://secure.gravatar.com
23+
script-src:
24+
- "'self'"
25+
- "'unsafe-eval'"
26+
- https://cdn.jsdelivr.net
27+
28+
lightspeed:
29+
servicePort: 8080
30+
prompts:
31+
- title: Getting Started with Red Hat Developer Hub
32+
message: Can you guide me through the first steps to start using Developer Hub as a developer, like exploring the Software Catalog and adding my service?
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Lightspeed is already in dynamic-plugins.default.yaml from the catalog index.
2+
# Do not add workspace metadata plugins here — nightly would duplicate OCI entries.
3+
plugins: []
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
allowed_models:
2+
- gpt-4o-mini
3+
- gpt-5.1
4+
- gpt-4.1-mini
5+
- gpt-4.1-nano
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Applied with envsubst before deploy. Keys must match charts/backstage/files/lightspeed/secret.yaml.
2+
# The Lightspeed Core sidecar loads this secret (see value_file.yaml global.lightspeed.secret).
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: rhdh-secrets
7+
type: Opaque
8+
stringData:
9+
ENABLE_VLLM: "true"
10+
ENABLE_VERTEX_AI: ""
11+
ENABLE_OPENAI: "true"
12+
ENABLE_OLLAMA: ""
13+
ENABLE_VALIDATION: ""
14+
VLLM_URL: $VAULT_VLLM_URL
15+
VLLM_API_KEY: $VAULT_VLLM_API_KEY
16+
VLLM_MAX_TOKENS: ""
17+
VLLM_TLS_VERIFY: ${VAULT_VLLM_TLS_VERIFY:-true}
18+
OPENAI_API_KEY: $VAULT_OPENAI_API_KEY
19+
VERTEX_AI_PROJECT: ""
20+
VERTEX_AI_LOCATION: ""
21+
GOOGLE_APPLICATION_CREDENTIALS: ""
22+
OLLAMA_URL: ""
23+
VALIDATION_PROVIDER: ""
24+
VALIDATION_MODEL_NAME: ""
25+
LLAMA_STACK_LOGGING: ""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Helm overrides for RHDH chart built-in Lightspeed (LCS sidecar + RAG init).
2+
# LLM credentials: rhdh-secrets.yaml (envsubst) — not lightspeed.servers in app-config.
3+
global:
4+
lightspeed:
5+
enabled: true
6+
secret:
7+
# Use the same secret e2e applies via rhdh-secrets.yaml (includes VLLM_* keys).
8+
create: false
9+
name: rhdh-secrets
10+
sidecar:
11+
env:
12+
# Required in OpenShift so LCS binds correctly in the pod network namespace.
13+
- name: SERVICE_HOST
14+
value: "0.0.0.0"

0 commit comments

Comments
 (0)