Skip to content

Commit

Permalink
Add e2e tests for streming endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
onmete committed Jan 9, 2025
1 parent 3e27816 commit f62aeb6
Show file tree
Hide file tree
Showing 3 changed files with 575 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ols/app/endpoints/streaming_ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,12 @@ async def response_processing_wrapper(
idx += 1
except PromptTooLongError as summarizer_error:
yield prompt_too_long_error(summarizer_error, media_type)
return # stop execution after error

except Exception as summarizer_error:
yield generic_llm_error(summarizer_error, media_type)
return # stop execution after error

timestamps["generate response"] = time.time()

store_data(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def setup_module(module):

# OLS_URL env only needs to be set when running against a local ols instance,
# when ols is run against a cluster the url is retrieved from the cluster.
ols_url = os.getenv("OLS_URL", "")
ols_url = os.getenv("OLS_URL", "http://localhost:8080")
if "localhost" not in ols_url:
pytest.on_cluster = True

Expand Down
Loading

0 comments on commit f62aeb6

Please sign in to comment.