Skip to content

Commit fc98df7

Browse files
are-cesclaude
andcommitted
LCORE-1422: Fix scenario to actually verify referenced_documents
The "Inline RAG query includes referenced documents" scenario was only checking rag_chunks and response format without verifying referenced documents. Replace with a dedicated referenced_documents assertion. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 94f1c37 commit fc98df7

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/e2e/features/inline_rag.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ Feature: Inline RAG (BYOK) support tests
4040
{"query": "What does Paul Graham say about great work?"}
4141
"""
4242
Then The status code of the response is 200
43-
And The response should have proper LLM response format
44-
And The response should contain non-empty rag_chunks
43+
And The response should contain non-empty referenced_documents

tests/e2e/features/steps/llm_query_response.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ def check_rag_chunks_present(context: Context) -> None:
145145
), "rag_chunks is empty — inline RAG did not inject any chunks"
146146

147147

148+
@then("The response should contain non-empty referenced_documents")
149+
def check_referenced_documents_present(context: Context) -> None:
150+
"""Check that the response contains non-empty referenced_documents."""
151+
assert context.response is not None
152+
response_json = context.response.json()
153+
assert (
154+
"referenced_documents" in response_json
155+
), "referenced_documents field missing from response"
156+
assert (
157+
len(response_json["referenced_documents"]) > 0
158+
), "referenced_documents is empty — no documents were referenced"
159+
160+
148161
@then("The response should contain following fragments")
149162
def check_fragments_in_response(context: Context) -> None:
150163
"""Check that all specified fragments are present in the LLM response.

0 commit comments

Comments
 (0)