Files
orchestrator/docs/work-items/ORCH-066/04-test-plan.yaml

185 lines
7.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
work_item: ORCH-066
description: >
Тест-план статусной модели Plane (слой B). Покрывает осмысленные статусы этапов,
возврат аналитика через To Analyse, фазы self-deploy, post-deploy monitor,
fail-closed деградацию и reconciler. Слой A (STAGE_TRANSITIONS) проверяется на
неизменность. Все тесты — pytest; Plane API мокается (httpx), как в существующих
tests/test_plane_*.py / tests/test_orch10_states.py.
tests:
# --- Группа A: вход и стадия анализа ---
- id: TC-01
type: unit
description: "To Analyse без существующего task -> handle_status_start -> start_pipeline (старт конвейера)."
module: tests/test_status_trigger.py
covers: [AC-1]
expected: PASS
- id: TC-02
type: integration
description: "To Analyse при существующем task без active-job -> relaunch агента стадии (resume из Needs Input), новый task НЕ создаётся."
module: tests/test_plane_to_analyse_resume.py
covers: [AC-2, BR-11]
expected: PASS
- id: TC-03
type: unit
description: "Старт/relaunch аналитика ставит Plane-статус Analysis (а не In Progress) при наличии статуса в проекте."
module: tests/test_plane_status_model.py
covers: [AC-3]
expected: PASS
- id: TC-04
type: unit
description: "To Analyse при существующем task с active-job -> НЕ relaunch (busy-guard)."
module: tests/test_plane_to_analyse_resume.py
covers: [AC-4]
expected: PASS
# --- Группа B: Code-Review ---
- id: TC-05
type: unit
description: "Вход в стадию review -> Plane-статус Code-Review (маппинг _STAGE_TO_STATE_KEY / STAGE_VISIBILITY_STATE)."
module: tests/test_plane_status_model.py
covers: [AC-5]
expected: PASS
# --- Группа C: self-deploy фазы ---
- id: TC-06
type: unit
description: "_handle_self_deploy_phase_a ставит Awaiting Deploy (не In Review)."
module: tests/test_deploy_approve.py
covers: [AC-6, AC-13]
expected: PASS
- id: TC-07
type: unit
description: "_handle_self_deploy_phase_b при успешном initiate_deploy ставит Deploying."
module: tests/test_deploy_approve.py
covers: [AC-7]
expected: PASS
- id: TC-08
type: integration
description: "Phase C (finalizer SUCCESS) для self-hosting ставит Monitoring after Deploy, НЕ Done; армит post-deploy monitor."
module: tests/test_deploy_terminal_sync.py
covers: [AC-8]
expected: PASS
- id: TC-09
type: integration
description: "Не-self репо: deploy->done ставит Done (без регресса, Monitoring не применяется)."
module: tests/test_deploy_terminal_sync.py
covers: [AC-9]
expected: PASS
# --- Группа D: post-deploy monitor ---
- id: TC-10
type: unit
description: "run_post_deploy_monitor HEALTHY + окно исчерпано -> Plane-статус Done."
module: tests/test_post_deploy.py
covers: [AC-10]
expected: PASS
- id: TC-11
type: unit
description: "run_post_deploy_monitor DEGRADED -> Plane-статус Blocked (+ ALERT_ONLY для self)."
module: tests/test_post_deploy.py
covers: [AC-11]
expected: PASS
- id: TC-12
type: unit
description: "Self-hosting тик НЕ рестартит/не откатывает прод-контейнер (ORCH-021 BR-5 сохранён)."
module: tests/test_post_deploy.py
covers: [AC-12]
expected: PASS
# --- Группа E: In Review / Needs Input / Cancelled ---
- id: TC-13
type: unit
description: "In Review ставится только за approve-pending конвейера (analyst BRD ready), не Phase A."
module: tests/test_analyst_status_only_regression.py
covers: [AC-13]
expected: PASS
- id: TC-14
type: unit
description: "set_issue_needs_input (analyst 01-questions.md) поведение идентично прежнему; не расширено на других агентов."
module: tests/test_plane_status_model.py
covers: [AC-14, BR-10]
expected: PASS
- id: TC-15
type: unit
description: "Перевод в Cancelled -> handle_issue_updated не выполняет advance/rollback (индикация, не управление)."
module: tests/test_plane_webhook.py
covers: [AC-15]
expected: PASS
# --- Группа F: fail-closed (критично) ---
- id: TC-16
type: unit
description: "Проект без новых статусов: get_project_states отдаёт default-алиасы (to_analyse=in_progress, code_review=review, awaiting_deploy=in_review, monitoring=done); исключений нет."
module: tests/test_plane_status_failclosed.py
covers: [AC-16, BR-12]
expected: PASS
- id: TC-17
type: unit
description: "Plane API down -> get_project_states fallback на _DEFAULT_STATES; set_issue_* never-raise."
module: tests/test_plane_status_failclosed.py
covers: [AC-16]
expected: PASS
- id: TC-18
type: integration
description: "enduro In Progress по-прежнему стартует конвейер через to_analyse-алиас."
module: tests/test_plane_status_failclosed.py
covers: [AC-17]
expected: PASS
- id: TC-19
type: unit
description: "Резолв по имени: при наличии статуса в проекте используется его UUID, а не default-алиас."
module: tests/test_orch10_states.py
covers: [AC-18]
expected: PASS
# --- Группа G: reconciler ---
- id: TC-20
type: integration
description: "F-2 _reconcile_plane_project запрашивает to_analyse и маршрутизирует к handle_status_start (потерянный webhook старта/resume)."
module: tests/test_reconciler_plane.py
covers: [AC-19]
expected: PASS
- id: TC-21
type: unit
description: "Guard 2: задачи в Awaiting Deploy / Deploying / Monitoring after Deploy НЕ оживляются F-1 как зависшие."
module: tests/test_reconciler.py
covers: [AC-20, BR-13]
expected: PASS
# --- Группа H: инварианты ---
- id: TC-22
type: unit
description: "STAGE_TRANSITIONS не изменён (явная проверка ключей/значений слоя A)."
module: tests/test_plane_status_model.py
covers: [AC-21]
expected: PASS
- id: TC-23
type: unit
description: "QG_CHECKS реестр и check_deploy_status контракты не изменены."
module: tests/test_plane_status_model.py
covers: [AC-22]
expected: PASS
- id: TC-24
type: integration
description: "Полный прогон pytest tests/ -q зелёный (регрессия)."
module: tests/
covers: [AC-23]
expected: PASS