From 6282d3e5f0ddcd89c491e415cce0db114d2a065c Mon Sep 17 00:00:00 2001 From: Sofiya Nuryyeva Date: Mon, 23 Nov 2026 16:15:44 -0500 Subject: [PATCH 1/3] removed skip-in-library and server mode tags --- docs/testing/e2e_testing.md | 22 ++++--- tests/e2e/features/byok_pdf.feature | 2 +- tests/e2e/features/environment.py | 22 +------ tests/e2e/features/mcp_servers_api.feature | 1 - tests/e2e/features/unified-mode-boot.feature | 59 +------------------ .../features/unified-mode-migration.feature | 18 +----- .../features/unified-mode-synthesis.feature | 13 +--- 7 files changed, 16 insertions(+), 121 deletions(-) diff --git a/docs/testing/e2e_testing.md b/docs/testing/e2e_testing.md index bced4e7ef0..653b4f81bf 100644 --- a/docs/testing/e2e_testing.md +++ b/docs/testing/e2e_testing.md @@ -133,8 +133,8 @@ uv run behave tests/e2e/features/query.feature --tags=-skip # Scenarios with a given tag (e.g. Authorized) uv run behave tests/e2e/features/query.feature --tags=Authorized -# Exclude a tag -uv run behave tests/e2e/features/health.feature --tags=-skip-in-library-mode +# Exclude skipped scenarios +uv run behave tests/e2e/features/health.feature --tags=-skip ``` --- @@ -287,7 +287,7 @@ For another YAML (`lightspeed-stack-okp-online.yaml`, tool RAG, and so on), repe | Variable | Default | Description | |---------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------| -| `E2E_DEPLOYMENT_MODE` | `server` | `server` or `library`. Drives config paths and which scenarios run (e.g. `@skip-in-library-mode`). | +| `E2E_DEPLOYMENT_MODE` | `server` | `server` or `library`. Drives config paths under `configuration/server-mode/` vs `configuration/library-mode/`. | | `E2E_LSC_HOSTNAME` | `localhost` | Host of the Lightspeed Core Stack API. | | `E2E_LSC_PORT` | `8080` | Port of the Lightspeed Core Stack API. | | `E2E_OGX_HOSTNAME` | `localhost` | Host of the OGX service (server mode). GitHub Actions repo variable: `E2E_LLAMA_HOSTNAME` (compose maps it here). | @@ -310,8 +310,8 @@ For local Docker runs, defaults are usually enough. Override when the stack is o ## Deployment Modes: Server vs Library -- **Server mode** (`E2E_DEPLOYMENT_MODE=server`): Lightspeed Core Stack talks to a **separate** OGX service (e.g. `OGX` container). Configs under `configuration/server-mode/` are used. Scenarios that need a dedicated OGX container (e.g. "OGX unreachable") run; those tagged `@skip-in-library-mode` run as well. -- **Library mode** (`E2E_DEPLOYMENT_MODE=library`): OGX runs **in-process** with the app. Configs under `configuration/library-mode/` are used. Scenarios tagged `@skip-in-library-mode` are skipped (no separate OGX to disrupt or query for shields). +- **Server mode** (`E2E_DEPLOYMENT_MODE=server`): Lightspeed Core Stack talks to a **separate** OGX service (e.g. `OGX` container). Configs under `configuration/server-mode/` are used. +- **Library mode** (`E2E_DEPLOYMENT_MODE=library`): OGX runs **in-process** with the app. Configs under `configuration/library-mode/` are used. Mode is set in `before_all` from `E2E_DEPLOYMENT_MODE` and stored as `context.is_library_mode`. @@ -328,7 +328,6 @@ All tag behaviour is implemented in **`features/environment.py`**: the hooks (`b | `@skip` | Scenario is skipped (reason: "Marked with @skip"). Use for broken or WIP scenarios. | | `@konflux-only` | Skipped unless `E2E_KONFLUX_E2E=1`. Used by `okp_rag.feature`. | | `@cfg_okp` | OKP Solr RAG. Konflux deploys OKP in `before_feature`. Local: [Running OKP RAG tests locally](#running-okp-rag-tests-locally). | -| `@skip-in-library-mode` | Scenario is skipped when `E2E_DEPLOYMENT_MODE=library`. Used for tests that require a separate OGX (e.g. connection disruption). | | `@local` | Skipped unless running in "local" mode (context flag). | | `@InvalidFeedbackStorageConfig` | Before scenario: switch to invalid-feedback-storage config and restart container. After: restore feature config and restart. | | `@NoCacheConfig` | Before scenario: switch to no-cache config and restart. After: restore and restart. | @@ -349,8 +348,7 @@ All tag behaviour is implemented in **`features/environment.py`**: the hooks (`b You can put several tags on one scenario. To document why a scenario is skipped, add a Gherkin comment above the tags: ```gherkin - # Only in server mode; OGX is in-process in library mode - @skip-in-library-mode + # WIP — needs a separate OGX container @skip Scenario: Check if service report proper readiness when OGX is not available ``` @@ -359,7 +357,7 @@ You can put several tags on one scenario. To document why a scenario is skipped, - **before_all**: Sets `deployment_mode`, `is_library_mode`, detects or overrides `default_model` / `default_provider`, sets `faiss_vector_store_id`. - **before_feature**: Applies feature-level config and restarts container for `Authorized`, `RBAC`, `RHIdentity`, `Feedback`, `MCP`. -- **before_scenario**: Skips scenarios for `@skip`, `@local`, `@skip-in-library-mode`; applies scenario config for `InvalidFeedbackStorageConfig` / `NoCacheConfig`. +- **before_scenario**: Skips scenarios for `@skip`, `@local`, `@konflux-only`, `@skip-in-prow`, and provider-matrix tags; applies scenario config for `InvalidFeedbackStorageConfig` / `NoCacheConfig`. - **after_scenario**: Restores OGX if it was disrupted; restores config and restarts for scenario config tags. - **after_feature**: Restores config and restarts for `Authorized`, `RBAC`, `RHIdentity`, `MCP`; deletes feedback conversations for `Feedback`. @@ -476,7 +474,7 @@ Here, **Given** sets state, **When** performs the HTTP call, **Then** and **And* | Syntax | Meaning | Example | |---------------|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------| -| **@tag** | Tag for filtering or hooks. Above Feature (applies to all scenarios) or above Scenario (that scenario only). | `@Authorized`, `@skip`, `@skip-in-library-mode` | +| **@tag** | Tag for filtering or hooks. Above Feature (applies to all scenarios) or above Scenario (that scenario only). | `@Authorized`, `@skip`, `@skip-in-prow` | | **# comment** | Gherkin comment. Ignored by Behave. Use to explain why a scenario is skipped or to document a scenario. | `# Only in server mode` above a scenario | @@ -536,7 +534,7 @@ The integration side of this boundary is described in ## Writing New Scenarios 1. **Confirm the scenario is e2e at all** — see [Choosing the Test Layer](#choosing-the-test-layer-e2e-or-integration). Then **choose or add a feature file** under `tests/e2e/features/` and use existing steps where possible. If you add a new file, **add it to `tests/e2e/test_list.txt`** so the suite runs it. -2. **Use tags** for mode-dependent or config-dependent behavior (`@skip-in-library-mode`, `@Authorized`, etc.). **Adding a tag that switches configuration** (e.g. a new feature-level or scenario-level config) usually means you must also add or change a **Lightspeed Stack config** file under `configuration/server-mode/` or `library-mode/` and wire the tag in `environment.py` (e.g. in `before_feature` / `after_feature` or `before_scenario` / `after_scenario`) so the config is applied and the container restarted when the tag is active. +2. **Use tags** for config-dependent behavior (`@Authorized`, `@cfg_*`, etc.). **Adding a tag that switches configuration** (e.g. a new feature-level or scenario-level config) usually means you must also add or change a **Lightspeed Stack config** file under `configuration/server-mode/` or `library-mode/` and wire the tag in `environment.py` (e.g. in `before_feature` / `after_feature` or `before_scenario` / `after_scenario`) so the config is applied and the container restarted when the tag is active. 3. **Use placeholders** `{MODEL}` and `{PROVIDER}` in request bodies so the same scenario works with different backends. 4. **Add step definitions** in the appropriate `features/steps/*.py` if you need new steps; reuse `context` for host, port, auth, and responses. 5. **Optional**: If the scenario needs a dedicated config, add a new YAML under `configuration/server-mode/` (and optionally `library-mode/`), add an entry to `_CONFIG_PATHS` in `environment.py`, and handle the tag in the before/after hooks so the config is switched and the lightspeed-stack container is restarted. @@ -551,7 +549,7 @@ The integration side of this boundary is described in - **Readonly database (SQLite) in OGX**: If the RAG KV DB is on a bind-mounted path that becomes read-only (e.g. after restart), move it to a named volume (e.g. via `KV_RAG_PATH` in docker-compose) so writes succeed. - **ChunkedEncodingError on streaming_query**: The step for streaming_query uses `stream=True` and consumes the stream; if you add new streaming steps, avoid reading the full response with `response.content` and use the same stream-reading pattern so a server close after an error event does not raise. - **Event loop is closed (httpx/AsyncClient)**: In E2E, any code that creates an `AsyncOgxClient` (e.g. for shields) must close it (e.g. `await client.close()`) in a `finally` block before the event loop is torn down (e.g. before `asyncio.run()` returns). -- **Scenarios skipped**: Check tags (`@skip`, `@skip-in-library-mode`, `@local`, `@konflux-only`) and `E2E_DEPLOYMENT_MODE`; ensure the scenario is not excluded by `--tags=-skip` (or the opposite if you intend to run only skipped scenarios for debugging). +- **Scenarios skipped**: Check tags (`@skip`, `@local`, `@konflux-only`, `@skip-in-prow`) and `E2E_DEPLOYMENT_MODE`; ensure the scenario is not excluded by `--tags=-skip` (or the opposite if you intend to run only skipped scenarios for debugging). - **Granite Guardian 403 / "Authentication failed"**: CI uses `mock-guardian` and needs no key. For a local real-model run, generate a key from [Models.corp Sandbox API Access](https://redhathub.service-now.com/hub?id=sc_cat_item&sys_id=882ad1b71bebd610b6ccea45624bcb3d&table=sc_cat_item&searchTerm=Models.corp%20Sandbox%20API%20Access) and put it in the shield YAML `api_key` (do not commit it). See [Granite Guardian: mock vs real](#granite-guardian-mock-ci-vs-real-model-local). For more on test structure and commands, see the main project guide (`CLAUDE.md`) and `tests/e2e/features/steps/README.md`. diff --git a/tests/e2e/features/byok_pdf.feature b/tests/e2e/features/byok_pdf.feature index 930314e2c2..26f86c8ab9 100644 --- a/tests/e2e/features/byok_pdf.feature +++ b/tests/e2e/features/byok_pdf.feature @@ -1,4 +1,4 @@ -@cfg_byok_pdf @skip-in-server-mode +@cfg_byok_pdf Feature: BYOK PDF support tests # Validates that a vector store built from a PDF by rag-content's `pdf` diff --git a/tests/e2e/features/environment.py b/tests/e2e/features/environment.py index 7942f5e67f..add856b14d 100644 --- a/tests/e2e/features/environment.py +++ b/tests/e2e/features/environment.py @@ -188,10 +188,8 @@ def before_scenario(context: Context, scenario: Scenario) -> None: resetting per-scenario Lightspeed override tracking and skip-restart flags. Skips the scenario if it has the `skip` tag, if it has the `local` tag - while the test run is not in local mode, if it has `konflux-only` when - ``E2E_KONFLUX_E2E`` is not ``1``, if it has `skip-in-library-mode` when - running in library mode, or if it has `skip-in-server-mode` when running - in server mode. Scenario-specific Lightspeed YAML is applied in the + while the test run is not in local mode, or if it has `konflux-only` when + ``E2E_KONFLUX_E2E`` is not ``1``. Scenario-specific Lightspeed YAML is applied in the feature files (``The service uses the ... configuration`` steps). """ if "skip" in scenario.effective_tags: @@ -204,22 +202,6 @@ def before_scenario(context: Context, scenario: Scenario) -> None: scenario.skip("Skipped outside Konflux (requires E2E_KONFLUX_E2E=1)") return - # Skip scenarios that require separate OGX container in library mode - if context.is_library_mode and "skip-in-library-mode" in scenario.effective_tags: - scenario.skip("Skipped in library mode (no separate OGX container)") - return - - # Skip scenarios that rely on a non-default BYOK store. Only library mode - # re-enriches the (in-process) OGX with the active config's byok_rag - # on restart; in server mode the external OGX keeps its startup - # config, so a feature-specific store would not be loaded. - if not context.is_library_mode and "skip-in-server-mode" in scenario.effective_tags: - scenario.skip( - "Skipped in server mode (feature-specific BYOK store is not loaded " - "into the external OGX service)" - ) - return - # Skip scenarios that depend on services not deployed in Prow/OpenShift # (e.g. mock-tls-inference, proxy sidecars only available in Docker Compose) if is_prow_environment() and "skip-in-prow" in scenario.effective_tags: diff --git a/tests/e2e/features/mcp_servers_api.feature b/tests/e2e/features/mcp_servers_api.feature index 2d7715ad46..dc8d7c1f12 100644 --- a/tests/e2e/features/mcp_servers_api.feature +++ b/tests/e2e/features/mcp_servers_api.feature @@ -76,7 +76,6 @@ Feature: MCP Server Management API tests Then The status code of the response is 422 And The body of the response contains scheme - @skip-in-library-mode Scenario: Register and delete MCP server lifecycle When I access REST API endpoint "mcp-servers" using HTTP POST method """ diff --git a/tests/e2e/features/unified-mode-boot.feature b/tests/e2e/features/unified-mode-boot.feature index 47a22ff41f..3ebc48c693 100644 --- a/tests/e2e/features/unified-mode-boot.feature +++ b/tests/e2e/features/unified-mode-boot.feature @@ -8,9 +8,7 @@ Feature: Unified mode configuration boot And the Lightspeed stack configuration directory is "tests/e2e/configuration/unified-mode" - # --- library mode (@skip-in-server-mode) --- - - @skip-in-server-mode @openai-only + @openai-only Scenario: Unified config with inference.providers boots and serves requests in library mode Given The service uses the lightspeed-stack-unified-providers.yaml configuration And The service is restarted @@ -31,7 +29,6 @@ Feature: Unified mode configuration boot Then The status code of the response is 200 - @skip-in-server-mode Scenario: Unified config with ogx.config only boots and serves requests in library mode Given The service uses the lightspeed-stack-unified-config-only.yaml configuration And The service is restarted @@ -44,7 +41,6 @@ Feature: Unified mode configuration boot Then The status code of the response is 200 - @skip-in-server-mode Scenario: Unified config with relative profile path boots in library mode Given The service uses the lightspeed-stack-unified-relative-profile.yaml configuration And The service is restarted @@ -52,61 +48,8 @@ Feature: Unified mode configuration boot Then The status code of the response is 200 - @skip-in-server-mode Scenario: Unified config with absolute profile path boots in library mode Given The service uses the lightspeed-stack-unified-absolute-profile.yaml configuration And The service is restarted When I access endpoint "readiness" using HTTP GET method Then The status code of the response is 200 - - - # --- server mode (@skip-in-library-mode) --- - - @skip-in-library-mode @openai-only - Scenario: Unified config with inference.providers boots and serves requests in server mode - Given The service uses the lightspeed-stack-unified-providers.yaml configuration - And Lightspeed Stack is restarted - When I access endpoint "readiness" using HTTP GET method - Then The status code of the response is 200 - And The body of the response has the following schema - """ - { - "ready": "bool", - "reason": "str", - "providers": "list[str]" - } - """ - When I use "query" to ask question - """ - {"query": "Say hello", "model": "{MODEL}", "provider": "{PROVIDER}"} - """ - Then The status code of the response is 200 - - - @skip-in-library-mode - Scenario: Unified config with ogx.config only boots and serves requests in server mode - Given The service uses the lightspeed-stack-unified-config-only.yaml configuration - And Lightspeed Stack is restarted - When I access endpoint "readiness" using HTTP GET method - Then The status code of the response is 200 - When I use "query" to ask question - """ - {"query": "Say hello", "model": "{MODEL}", "provider": "{PROVIDER}"} - """ - Then The status code of the response is 200 - - - @skip-in-library-mode - Scenario: Unified config with relative profile path boots in server mode - Given The service uses the lightspeed-stack-unified-relative-profile.yaml configuration - And Lightspeed Stack is restarted - When I access endpoint "readiness" using HTTP GET method - Then The status code of the response is 200 - - - @skip-in-library-mode - Scenario: Unified config with absolute profile path boots in server mode - Given The service uses the lightspeed-stack-unified-absolute-profile.yaml configuration - And Lightspeed Stack is restarted - When I access endpoint "readiness" using HTTP GET method - Then The status code of the response is 200 diff --git a/tests/e2e/features/unified-mode-migration.feature b/tests/e2e/features/unified-mode-migration.feature index 41fd513f27..227453b6ba 100644 --- a/tests/e2e/features/unified-mode-migration.feature +++ b/tests/e2e/features/unified-mode-migration.feature @@ -17,9 +17,8 @@ Feature: Legacy to unified configuration migration # tests/e2e/configs/run-ci.yaml) and guarded against CLI drift by that same # integration module. It inlines the openai run-ci.yaml, hence @openai-only. - # --- library mode (@skip-in-server-mode) --- - @skip-in-server-mode @openai-only + @openai-only Scenario: Migrated unified configuration boots and serves queries in library mode Given The service uses the lightspeed-stack-unified-migrated.yaml configuration And The service is restarted @@ -30,18 +29,3 @@ Feature: Legacy to unified configuration migration {"query": "Say hello", "model": "{MODEL}", "provider": "{PROVIDER}"} """ Then The status code of the response is 200 - - - # --- server mode (@skip-in-library-mode) --- - - @skip-in-library-mode @openai-only - Scenario: Migrated unified configuration boots and serves queries in server mode - Given The service uses the lightspeed-stack-unified-migrated.yaml configuration - And Lightspeed Stack is restarted - When I access endpoint "readiness" using HTTP GET method - Then The status code of the response is 200 - When I use "query" to ask question - """ - {"query": "Say hello", "model": "{MODEL}", "provider": "{PROVIDER}"} - """ - Then The status code of the response is 200 diff --git a/tests/e2e/features/unified-mode-synthesis.feature b/tests/e2e/features/unified-mode-synthesis.feature index a7ac71528c..f9fa50f4d6 100644 --- a/tests/e2e/features/unified-mode-synthesis.feature +++ b/tests/e2e/features/unified-mode-synthesis.feature @@ -15,19 +15,8 @@ Feature: Unified mode configuration synthesis # is the one thing only a deployed stack can show: the synthesized path is # logged at startup (R10). - # --- library mode (@skip-in-server-mode) --- - - @skip-in-server-mode @openai-only + @openai-only Scenario: Synthesized run.yaml path is logged at startup in library mode Given The service uses the lightspeed-stack-unified-providers.yaml configuration And The service is restarted Then the lightspeed-stack container logs contain synthesized run.yaml - - - # --- server mode (@skip-in-library-mode) --- - - @skip-in-library-mode @openai-only - Scenario: Synthesized run.yaml path is logged at startup in server mode - Given The service uses the lightspeed-stack-unified-providers.yaml configuration - And Lightspeed Stack is restarted - Then the lightspeed-stack container logs contain synthesized run.yaml From 2a013216895431399520e1f8d716bc4f8d581617 Mon Sep 17 00:00:00 2001 From: Sofiya Nuryyeva Date: Mon, 23 Nov 2026 16:20:30 -0500 Subject: [PATCH 2/3] doc. update --- docs/testing/e2e_testing.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/testing/e2e_testing.md b/docs/testing/e2e_testing.md index 653b4f81bf..e289b6d45c 100644 --- a/docs/testing/e2e_testing.md +++ b/docs/testing/e2e_testing.md @@ -348,9 +348,8 @@ All tag behaviour is implemented in **`features/environment.py`**: the hooks (`b You can put several tags on one scenario. To document why a scenario is skipped, add a Gherkin comment above the tags: ```gherkin - # WIP — needs a separate OGX container - @skip - Scenario: Check if service report proper readiness when OGX is not available + @skip @cfg_authorized + Scenario: V2 conversations endpoint WITHOUT no_tools (known bug - empty vector DB) ``` ### Hooks (environment.py) From 32ef8efe9b91849b69ceab7819df581609451f8e Mon Sep 17 00:00:00 2001 From: Sofiya Nuryyeva Date: Tue, 24 Nov 2026 10:30:57 -0500 Subject: [PATCH 3/3] doc. update --- docs/testing/e2e_testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing/e2e_testing.md b/docs/testing/e2e_testing.md index e289b6d45c..f595cdf22f 100644 --- a/docs/testing/e2e_testing.md +++ b/docs/testing/e2e_testing.md @@ -356,7 +356,7 @@ You can put several tags on one scenario. To document why a scenario is skipped, - **before_all**: Sets `deployment_mode`, `is_library_mode`, detects or overrides `default_model` / `default_provider`, sets `faiss_vector_store_id`. - **before_feature**: Applies feature-level config and restarts container for `Authorized`, `RBAC`, `RHIdentity`, `Feedback`, `MCP`. -- **before_scenario**: Skips scenarios for `@skip`, `@local`, `@konflux-only`, `@skip-in-prow`, and provider-matrix tags; applies scenario config for `InvalidFeedbackStorageConfig` / `NoCacheConfig`. +- **before_scenario**: Skips scenarios for `@skip`, `@local`, `@konflux-only`, and `@skip-in-prow`; applies scenario config for `InvalidFeedbackStorageConfig` / `NoCacheConfig`. - **after_scenario**: Restores OGX if it was disrupted; restores config and restarts for scenario config tags. - **after_feature**: Restores config and restarts for `Authorized`, `RBAC`, `RHIdentity`, `MCP`; deletes feedback conversations for `Feedback`.