Skip to content

[Enh] Add E2E lifecycle scenarios, xfail gap documentation, and CI integration #194

@GunaPalanivel

Description

@GunaPalanivel

Context

This PR builds on the E2E scaffolding introduced in Part 1 and adds lifecycle coverage plus a minimal CI step. No Java/Maven changes.


What This PR Adds

  • tests/e2e/test_chat_lifecycle.py with 5 lifecycle scenarios
  • A non-breaking E2E step appended to CI

Scenarios

  1. test_session_survives_restart
    Marked xfail
    Blocked by session_exists() only checks in-memory store, ignores persisted sessions on disk #175session_exists() does not check disk

  2. test_websocket_stream_persists
    Marked xfail
    Blocked by WebSocket streaming messages are not persisted to disk #173 — WebSocket handler does not call persist_session()

  3. test_upload_without_message_returns_200
    Passing — validates fix from Upload endpoint returns 422 when message field is omitted with files #184

  4. test_agentic_pipeline_no_type_error
    Passing — validates [Enh] get_chatbot_reply_new_architecture() is never called — agentic pipeline is unreachable dead code #189 / [Bug] _execute_search_tools() crashes with TypeError — unguarded TOOL_REGISTRY miss and missing logger injection for 3/4 tools #190

  5. test_cross_user_upload_blocked
    Passing — validates [DESIGN GAP] Multipart file uploads bypass user_id injection — authenticated users skip ownership validation #168


On xfail

Scenarios 1 and 2 are marked:

@pytest.mark.xfail(strict=False, reason="Blocked by #NNN: ...")
  • strict=False keeps CI green while the underlying bug exists
  • If the bug is fixed and the test unexpectedly passes, it shows as XPASS

These tests serve as acceptance gates for #175 and #173.
They are intentionally added before the fixes land.

Do not remove xfail without confirming the blocking issue is resolved.


CI Addition

Append a single step to ci-backend-test.yml after integration tests:

- name: Run E2E tests
  working-directory: chatbot-core
  env:
    PYTHONPATH: ${{ github.workspace }}/chatbot-core
    E2E_STUB_LLM: "true"
    E2E_SEED_FAISS: "true"
  run: pytest tests/e2e -m e2e -v
  • No model downloads
  • No API keys
  • Runtime ~30s
  • Does not modify existing CI behavior

xfail → Pass Conversion


Acceptance Criteria

  • All 5 scenarios implemented in tests/e2e/test_chat_lifecycle.py
  • Scenarios 1 & 2 marked xfail(strict=False) with correct issue reference
  • tests/e2e/fixtures/sample.txt present
  • pytest tests/e2e -m e2e -v passes locally
    (Scenarios 1 & 2 show xfail, not FAILED)
  • CI step added in ci-backend-test.yml
  • Zero Java/Maven changes

Related Issues

Are you interested in contributing this feature?

Yes — I will raise the PR for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions