Skip to content

Commit e04b534

Browse files
authored
LCORE-3537: E2E tests rework (lightspeed-core#2421)
* E2E tests rework * Set default otel env variable values
1 parent d32aeed commit e04b534

83 files changed

Lines changed: 875 additions & 573 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/e2e_tests.yaml‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,32 @@ jobs:
1111
matrix:
1212
mode: ["server", "library"]
1313
environment: ["ci"]
14-
e2e_group: [1, 2, 3]
14+
# Config-aligned shards (@cfg_*). Packed small groups keep job count reasonable
15+
# while avoiding mixed-config restarts inside large suites.
16+
shard:
17+
- name: default
18+
tags: "not @skip and @cfg_default"
19+
- name: authorized
20+
tags: "not @skip and @cfg_authorized"
21+
- name: mcp
22+
tags: "not @skip and (@cfg_mcp or @cfg_mcp_invalid or @cfg_mcp_api_auth)"
23+
- name: rbac
24+
tags: "not @skip and @cfg_rbac"
25+
- name: skills
26+
tags: "not @skip and (@cfg_skills or @cfg_skills_directory)"
27+
- name: other
28+
tags: "not @skip and (@cfg_rh_identity or @cfg_negative or @cfg_byok_pdf or @cfg_degraded or @cfg_unified)"
29+
# Server-only; listed in shard (not matrix.include) so it expands with
30+
# mode=server before any library jobs. include would append after library.
31+
- name: tls
32+
tags: "not @skip and @cfg_tls"
33+
exclude:
34+
- mode: library
35+
shard:
36+
name: tls
37+
tags: "not @skip and @cfg_tls"
1538

16-
name: "E2E: ${{ matrix.mode }} mode / ${{ matrix.environment }} / group ${{ matrix.e2e_group }}"
39+
name: "E2E: ${{ matrix.mode }} / ${{ matrix.environment }} / ${{ matrix.shard.name }}"
1740

1841
env:
1942
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -43,7 +66,7 @@ jobs:
4366
persist-credentials: ${{ github.event_name != 'pull_request_target' }}
4467

4568
# Fetch submodules (required for lightspeed-providers)
46-
submodules: ‘recursive’
69+
submodules: "recursive"
4770

4871
- name: Verify actual git checkout result
4972
run: |
@@ -112,7 +135,7 @@ jobs:
112135
echo "=== Configuration Summary ==="
113136
echo "Deployment mode: ${{ matrix.mode }}"
114137
echo "Environment: ${{ matrix.environment }}"
115-
echo "E2E shard (Makefile test-e2e-tagged): @e2e_group_${{ matrix.e2e_group }} (with not @skip)"
138+
echo "E2E shard (Makefile test-e2e-tagged): ${{ matrix.shard.tags }}"
116139
echo "Source config: tests/e2e/configs/run-${{ matrix.environment }}.yaml"
117140
echo ""
118141
echo "=== Configuration Preview ==="
@@ -239,8 +262,8 @@ jobs:
239262
TERM: xterm-256color
240263
FORCE_COLOR: 1
241264
E2E_DEPLOYMENT_MODE: ${{ matrix.mode }}
242-
# Matches Makefile test-e2e-tagged / E2E_BEHAVE_TAG_EXPR (one @e2e_group_* per job).
243-
E2E_BEHAVE_TAG_EXPR: "not @skip and @e2e_group_${{ matrix.e2e_group }}"
265+
# Matches Makefile test-e2e-tagged / E2E_BEHAVE_TAG_EXPR (one @cfg_* pack per job).
266+
E2E_BEHAVE_TAG_EXPR: "${{ matrix.shard.tags }}"
244267
run: |
245268
echo "Installing test dependencies..."
246269
pip install uv

‎.tekton/integration-tests/pipeline/lightspeed-stack-integration-test.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ spec:
270270
value: "$(params.namespace)"
271271
- name: SNAPSHOT
272272
value: $(params.SNAPSHOT)
273+
- name: OTEL_SDK_DISABLED
274+
value: "true"
275+
- name: OTEL_ANONYMIZATION_SECRET
276+
value: "lightspeed-stack-otel-anonymization-dev-default"
273277
image: registry.access.redhat.com/ubi9/ubi-minimal
274278
script: |
275279
set +e

‎.tekton/integration-tests/pipeline/lightspeed-stack-rhelai-test.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ spec:
396396
value: "$(params.vllm-api-key)"
397397
- name: VLLM_MODEL
398398
value: "$(params.model)"
399+
- name: OTEL_SDK_DISABLED
400+
value: "true"
401+
- name: OTEL_ANONYMIZATION_SECRET
402+
value: "lightspeed-stack-otel-anonymization-dev-default"
399403
image: registry.access.redhat.com/ubi9/ubi-minimal
400404
script: |
401405
set +e

‎Makefile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ test-e2e: ## Run end to end tests for the service
162162
test-e2e-local: ## Run end to end tests for the service (no script wrapper)
163163
uv run behave --color --format pretty --tags=-skip -D dump_errors=true @tests/e2e/test_list.txt
164164

165-
# Tag-based subsets (@e2e_group_* on feature files). Default runs all groups; override for one shard, e.g.
166-
# E2E_BEHAVE_TAG_EXPR='not @skip and @e2e_group_2' make test-e2e-tagged-local
167-
E2E_BEHAVE_TAG_EXPR ?= not @skip and (e2e_group_1 or e2e_group_2 or e2e_group_3)
165+
# Tag-based subsets (@cfg_* on features/scenarios). Default runs all config groups; override for one shard, e.g.
166+
# E2E_BEHAVE_TAG_EXPR='not @skip and @cfg_authorized' make test-e2e-tagged-local
167+
E2E_BEHAVE_TAG_EXPR ?= not @skip and (@cfg_default or @cfg_authorized or @cfg_mcp or @cfg_mcp_invalid or @cfg_mcp_api_auth or @cfg_rbac or @cfg_rh_identity or @cfg_negative or @cfg_skills or @cfg_skills_directory or @cfg_byok_pdf or @cfg_tls or @cfg_degraded or @cfg_unified)
168168

169-
test-e2e-tagged: ## Run e2e tests with E2E_BEHAVE_TAG_EXPR (default: all @e2e_group_*)
169+
test-e2e-tagged: ## Run e2e tests with E2E_BEHAVE_TAG_EXPR (default: all @cfg_*)
170170
script -q -e -c "uv run behave --color --format pretty --tags=\"$(E2E_BEHAVE_TAG_EXPR)\" -D dump_errors=true @tests/e2e/test_list.txt"
171171

172172
test-e2e-tagged-local: ## Same as test-e2e-tagged without script wrapper

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ test-unit Run the unit tests
920920
test-integration Run integration tests tests
921921
test-e2e Run end to end tests for the service
922922
test-e2e-local Run end to end tests for the service (no script wrapper)
923-
test-e2e-tagged Run e2e tests with E2E_BEHAVE_TAG_EXPR (default: all @e2e_group_*)
923+
test-e2e-tagged Run e2e tests with E2E_BEHAVE_TAG_EXPR (default: all @cfg_*)
924924
test-e2e-tagged-local Same as test-e2e-tagged without script wrapper
925925
benchmarks Run benchmarks
926926
check-types-src Check type hints in sources only

‎docker-compose-library.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ services:
6565
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
6666
- OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-}
6767
- OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-}
68+
- OTEL_ANONYMIZATION_SECRET=${OTEL_ANONYMIZATION_SECRET:-lightspeed-stack-otel-anonymization-dev-default}
6869
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED:-true}
6970
healthcheck:
7071
test: ["CMD", "curl", "-f", "http://localhost:8080/liveness"]

‎docker-compose.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ services:
107107
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
108108
- OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-}
109109
- OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-}
110+
- OTEL_ANONYMIZATION_SECRET=${OTEL_ANONYMIZATION_SECRET:-lightspeed-stack-otel-anonymization-dev-default}
110111
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED:-true}
111112
depends_on:
112113
llama-stack:

‎docs/testing/e2e_testing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ You can put several tags on one scenario. To document why a scenario is skipped,
214214

215215
## Configuration Files
216216

217-
- **Lightspeed-stack**: Under `tests/e2e/configuration/server-mode/` and `library-mode/`. Switched via `switch_config()` and copied into the container's config path (or applied via ConfigMap in Prow). Names like `lightspeed-stack.yaml`, `lightspeed-stack-auth-noop-token.yaml`, `lightspeed-stack-rbac.yaml`, etc.
217+
- **Lightspeed-stack**: Under `tests/e2e/configuration/server-mode/` and `library-mode/`. Switched via `switch_config()` and copied into the container's config path (or applied via ConfigMap in Prow). Bootstrap: `lightspeed-stack.yaml`; variants: `lightspeed-stack-default.yaml`, `lightspeed-stack-authorized.yaml`, `lightspeed-stack-rbac.yaml`, etc. (see `tests/e2e/configuration/grouped/README.md`).
218218
- **Llama Stack**: Under `tests/e2e/configs/` (e.g. `run-ci.yaml`). Used by the Llama Stack container; not switched by Behave step-by-step, but the stack is started with the appropriate run config.
219219

220220
See `tests/e2e/configuration/README.md` for a short description of each config.

‎tests/e2e-prow/rhoai/manifests/lightspeed/lightspeed-stack.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ spec:
5757
# Unused for server-mode FAISS (llama pod owns the fixture); keep out of ~/.llama.
5858
- name: KV_RAG_PATH
5959
value: "/app-root/.e2e-rag-work/kv_store.db"
60+
- name: OTEL_SDK_DISABLED
61+
value: "true"
62+
- name: OTEL_ANONYMIZATION_SECRET
63+
value: "lightspeed-stack-otel-anonymization-dev-default"
6064
- name: VLLM_MODEL
6165
valueFrom:
6266
secretKeyRef:

‎tests/e2e/configuration/README.md‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,27 @@ Both server-mode and library-mode default configurations include:
5454

5555
3. **User Data Collection** - Enabled for feedback and transcripts testing
5656

57-
### Special-Purpose Configurations
57+
### Config variants (`@cfg_*` tags)
58+
59+
Named configs merge compatible options and map to `@cfg_*` Behave tags so CI
60+
can shard by config (fewer restarts per job). See
61+
[grouped/README.md](grouped/README.md).
62+
63+
| Config | Purpose |
64+
|--------|---------|
65+
| `lightspeed-stack-default.yaml` | Default + inline RAG |
66+
| `lightspeed-stack-authorized.yaml` | Authorization (noop-token) |
67+
| `lightspeed-stack-negative.yaml` | No cache + invalid feedback storage |
68+
| `lightspeed-stack-rbac.yaml` | RBAC (jwk-token auth) |
69+
| `lightspeed-stack-rh-identity.yaml` | RH Identity header auth |
70+
| `lightspeed-stack-skills.yaml` / `-skills-directory.yaml` | Agent skills |
71+
| `lightspeed-stack-mcp.yaml` | All valid MCP servers (`mcp_servers_api`) |
72+
| `lightspeed-stack-mcp-invalid.yaml` | Invalid MCP file token |
73+
| `lightspeed-stack-mcp-api-auth.yaml` | MCP server API auth |
74+
| `lightspeed-stack-mcp-{file,kubernetes,client,oauth}-auth.yaml` | Per-auth MCP (`mcp.feature`) |
75+
| `lightspeed-stack-byok-pdf.yaml` | BYOK PDF (library only) |
76+
| `lightspeed-stack-tls.yaml` / `-degraded.yaml` | TLS / degraded mode (server only) |
77+
78+
Bootstrap default: `lightspeed-stack.yaml`. Environment-specific:
79+
`lightspeed-stack-rhelai.yaml`, `lightspeed-stack-rhoai.yaml`.
5880

59-
- `lightspeed-stack-auth-noop-token.yaml` - For authorization testing
60-
- `lightspeed-stack-invalid-feedback-storage.yaml` - For negative feedback testing
61-
- `lightspeed-stack-no-cache.yaml` - For cache-disabled scenarios

0 commit comments

Comments
 (0)