Skip to content

fix(tests): ISSUE-267 backend test drift batches 1-2 + EventContext schema - #883

Draft
cursor[bot] wants to merge 5 commits into
mainfrom
fix/issue-267-backend-test-suite
Draft

fix(tests): ISSUE-267 backend test drift batches 1-2 + EventContext schema#883
cursor[bot] wants to merge 5 commits into
mainfrom
fix/issue-267-backend-test-suite

Conversation

@cursor

@cursor cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes backend test drift clusters for ISSUE-267 by updating tests and contracts to match current production behavior.

Batch 1 — Celery / graph quick fixes

  • Add generate_report to _fake_body mock in celery redelivery matrix test
  • Update dispatch_investigation kwargs assertions to include generate_report: True
  • Add register_script to _FakeRedis for broker-unavailable 503 test
  • Update graph empty-response expectation for degraded / summary fields

Batch 2 — Detection scope tests

  • Avoid violating uq_detection_scope_revision_one_active_per_instance when testing ambiguous scope binding
  • Shared helpers: mock resolver for hook test; intercept session.scalars for resolver/service tests
  • Relax concurrent activate test to allow expected IntegrityError race on per-instance unique index

Contracts

  • Sync contracts/schemas/EventContext.json with InvestigationReport.degraded computed field (serialization schema)

Test status

  • All targeted batch 1/2/3 celery & detection-scope tests pass
  • Full suite: 4233 passed, 35 failed (pre-existing / out-of-scope drift on this branch)
Open in Web View Automation 

cursoragent and others added 5 commits August 8, 2026 09:06
Co-authored-by: hust..munos <3353532706@qq.com>
… drift

Co-authored-by: hust..munos <3353532706@qq.com>
…egraded field

Co-authored-by: hust..munos <3353532706@qq.com>
- Add shared db_isolation (TRUNCATE + Redis cleanup) with proper ORM import
- Fix test setup: FK-safe teardown order, connector seeds, audit/guard context
- Update tests for current semantics (analysis_only API, chat mock, trace projection)
- Fix mock pipeline signatures and background task scheduling in events API tests
- Pass compensation writeback guard_context; flush on scope activation retire
- Export EventContext contract; align schema export test with model_json_schema()
- Playbook ledger replay via _prepare_response_plan_task_for_claim

Co-authored-by: hust..munos <3353532706@qq.com>
Upload junit-default and timing-round XML artifacts; surface the 25 slowest
tests (>=0.5s) in CI logs. Align make ci-test with the same pytest flags.

Co-authored-by: hust..munos <3353532706@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant