Skip to content

Commit af81305

Browse files
committed
Fixed e2e test inconsistencies
1 parent 536d6a0 commit af81305

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

tests/e2e/features/conversation_cache_v2.feature

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Feature: Conversation Cache V2 API tests
212212
@NoCacheConfig
213213
Scenario: Check conversations/{conversation_id} fails when cache not configured
214214
Given REST API service prefix is /v2
215+
And An invalid conversation cache path is configured
215216
And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
216217
When I access REST API endpoint "conversations" using HTTP GET method
217218
Then The status code of the response is 500
@@ -280,8 +281,11 @@ Feature: Conversation Cache V2 API tests
280281
Given REST API service prefix is /v2
281282
And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
282283
When I use REST API conversation endpoint with conversation_id "12345678-abcd-0000-0123-456789abcdef" using HTTP DELETE method
283-
Then The status code of the response is 404
284-
And The body of the response contains Conversation not found
284+
Then The status code of the response is 200
285+
And The body of the response, ignoring the "conversation_id" field, is the following
286+
"""
287+
{"success": true, "response": "Conversation cannot be deleted"}
288+
"""
285289

286290
@skip-in-library-mode
287291
Scenario: V2 conversations DELETE endpoint works even when llama-stack is down

tests/e2e/features/environment.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ def before_scenario(context: Context, scenario: Scenario) -> None:
9595
context.scenario_config = (
9696
f"tests/e2e/configuration/{mode_dir}/lightspeed-stack-no-cache.yaml"
9797
)
98-
# Switch config and restart immediately
99-
switch_config(
100-
context.scenario_config
101-
) # Copies to default lightspeed-stack.yaml
102-
restart_container("lightspeed-stack")
10398

10499

105100
def after_scenario(context: Context, scenario: Scenario) -> None:

tests/e2e/features/steps/conversation.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from behave import step, when, then # pyright: ignore[reportAttributeAccessIssue]
55
from behave.runner import Context
66
import requests
7-
from tests.e2e.utils.utils import replace_placeholders
7+
from tests.e2e.utils.utils import replace_placeholders, restart_container, switch_config
88

99
# default timeout for HTTP operations
1010
DEFAULT_TIMEOUT = 10
@@ -341,3 +341,10 @@ def check_conversation_model_provider(
341341
assert (
342342
actual_provider == expected_provider
343343
), f"Turn {idx} expected provider '{expected_provider}', got '{actual_provider}'"
344+
345+
346+
@given("An invalid conversation cache path is configured") # type: ignore
347+
def configure_invalid_conversation_cache_path(context: Context) -> None:
348+
"""Set an invalid conversation cache path and restart the container."""
349+
switch_config(context.scenario_config)
350+
restart_container("lightspeed-stack")

0 commit comments

Comments
 (0)