Skip to content

Task 8 — Tests and E2E validation #187

Description

@hiydavid

Part of #179.

Goal

Add test coverage for the new behavior: finding → lever mapping, preflight hard-blocks, Delta snapshot write/read, and the full CTA → Optimizer E2E flow.

Work

  • Leave backend/tests/test_fix_agent_prompt.py and backend/tests/test_fix_agent_paths.py in place (backend stays per Task 1), but add a one-liner "Fix Agent UI deprecated — see Workbench 0.2 for full removal" comment at the top of each file
  • New unit test for the finding → lever mapping logic (wherever it lives — likely backend/routers/auto_optimize.py or a new backend/services/optimizer_signals.py)
  • New unit test for preflight hard-block — mock scanner to return a scan result with Check 1 fail → expect 400; Check 10 fail → expect 400; all pass → expect job submission
  • Integration test for Delta snapshot write/read path against a real workspace (extend tests/test_e2e_deployed.py or add a new tests/test_optimizer_scan_snapshots.py)
  • Playwright E2E: IQ Score tab CTA click → lands on Optimize tab with correct levers pre-selected. Extend tests/test_e2e_deployed.py.
  • Playwright E2E: trigger an Optimizer run, confirm RunDetailView shows preflight scan snapshot

Acceptance

  • pytest backend/tests/ passes
  • Deployed E2E tests pass against a workspace with a known space
  • Preflight block scenarios are covered
  • Delta persistence is exercised end-to-end

Files

  • backend/tests/test_fix_agent_prompt.py (add deprecation comment)
  • backend/tests/test_fix_agent_paths.py (add deprecation comment)
  • backend/tests/test_optimizer_signals.py (new)
  • backend/tests/test_optimizer_preflight.py (new)
  • tests/test_e2e_deployed.py (extend)
  • tests/test_optimizer_scan_snapshots.py (new, optional split)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:choreMaintenance / hygiene

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions