Skip to content

Commit ee3a48f

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 <noreply@anthropic.com>
1 parent c58bbe1 commit ee3a48f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

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
@@ -147,6 +147,19 @@ def check_rag_chunks_present(context: Context) -> None:
147147
), "rag_chunks is empty — inline RAG did not inject any chunks"
148148

149149

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

0 commit comments

Comments
 (0)