test(e2e): wire OneDrive fake into harness

This commit is contained in:
Anish Sarkar 2026-05-08 03:48:35 +05:30
parent 3ee633cb23
commit da8b151634
3 changed files with 51 additions and 0 deletions

View file

@ -18,6 +18,8 @@ GMAIL_CANARY_SUBJECT = "E2E Canary Email"
GMAIL_CANARY_MESSAGE_ID = "fake-msg-canary-001"
CALENDAR_CANARY_TOKEN = "SURFSENSE_E2E_CANARY_TOKEN_CALENDAR_001"
CALENDAR_CANARY_SUMMARY = "E2E Canary Calendar Event"
ONEDRIVE_CANARY_TOKEN = "SURFSENSE_E2E_CANARY_TOKEN_ONEDRIVE_001"
ONEDRIVE_CANARY_FILE = "e2e-onedrive-canary.txt"
NOTION_CANARY_TOKEN = "SURFSENSE_E2E_CANARY_TOKEN_NOTION_001"
NOTION_CANARY_TITLE = "E2E Canary Notion Page"
CONFLUENCE_CANARY_TOKEN = "SURFSENSE_E2E_CANARY_TOKEN_CONFLUENCE_001"
@ -131,6 +133,10 @@ class FakeChatLLM(BaseChatModel):
latest_human,
("drive", "file", "e2e-canary.txt"),
)
wants_onedrive = _contains_any(
latest_human,
("onedrive", ONEDRIVE_CANARY_FILE, ONEDRIVE_CANARY_TOKEN),
)
wants_notion = _contains_any(
latest_human,
("notion", "page", NOTION_CANARY_TITLE),
@ -172,6 +178,11 @@ class FakeChatLLM(BaseChatModel):
or "fake-file-canary" in prompt_text
or DRIVE_CANARY_TOKEN in prompt_text
)
has_onedrive_evidence = (
ONEDRIVE_CANARY_FILE in prompt_text
or "fake-onedrive-canary" in prompt_text
or ONEDRIVE_CANARY_TOKEN in prompt_text
)
has_notion_evidence = (
NOTION_CANARY_TITLE in prompt_text or NOTION_CANARY_TOKEN in prompt_text
)
@ -215,6 +226,8 @@ class FakeChatLLM(BaseChatModel):
return f"Calendar content found: {CALENDAR_CANARY_TOKEN}"
if wants_gmail and has_gmail_evidence:
return f"Gmail content found: {GMAIL_CANARY_TOKEN}"
if wants_onedrive and has_onedrive_evidence:
return f"OneDrive content found: {ONEDRIVE_CANARY_TOKEN}"
if wants_drive and has_drive_evidence:
return f"Drive content found: {DRIVE_CANARY_TOKEN}"
if (
@ -225,6 +238,7 @@ class FakeChatLLM(BaseChatModel):
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Notion content found: {NOTION_CANARY_TOKEN}"
@ -236,6 +250,7 @@ class FakeChatLLM(BaseChatModel):
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Confluence content found: {CONFLUENCE_CANARY_TOKEN}"
@ -247,6 +262,7 @@ class FakeChatLLM(BaseChatModel):
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Jira content found: {JIRA_CANARY_TOKEN}"
@ -258,6 +274,7 @@ class FakeChatLLM(BaseChatModel):
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Linear content found: {LINEAR_CANARY_TOKEN}"
@ -269,6 +286,7 @@ class FakeChatLLM(BaseChatModel):
and not has_notion_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Calendar content found: {CALENDAR_CANARY_TOKEN}"
@ -279,9 +297,22 @@ class FakeChatLLM(BaseChatModel):
and not has_linear_evidence
and not has_notion_evidence
and not has_drive_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Gmail content found: {GMAIL_CANARY_TOKEN}"
if (
has_onedrive_evidence
and not has_confluence_evidence
and not has_jira_evidence
and not has_linear_evidence
and not has_notion_evidence
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_slack_evidence
):
return f"OneDrive content found: {ONEDRIVE_CANARY_TOKEN}"
if (
has_drive_evidence
and not has_confluence_evidence
@ -289,6 +320,7 @@ class FakeChatLLM(BaseChatModel):
and not has_linear_evidence
and not has_notion_evidence
and not has_gmail_evidence
and not has_onedrive_evidence
and not has_slack_evidence
):
return f"Drive content found: {DRIVE_CANARY_TOKEN}"
@ -301,6 +333,7 @@ class FakeChatLLM(BaseChatModel):
and not has_calendar_evidence
and not has_gmail_evidence
and not has_drive_evidence
and not has_onedrive_evidence
):
return f"Slack content found: {SLACK_CANARY_TOKEN}"
return NO_RELEVANT_CONTENT_SENTINEL