Skip to content

[FEATURE] #879 - Unit and integration tests for multi-agent execution modes #908

@stephanj

Description

@stephanj

Parent Issue

Part of #879 — Support Multi-Agent Execution Modes Per Task

Task

Comprehensive test coverage for the multi-agent execution feature.

Test Cases

TaskExecutionMode Config Tests

  • Enum serializes/deserializes to task YAML correctly
  • Per-task override takes precedence over global default
  • Missing field defaults to null (falls back to global)
  • Global default persists across settings changes

AgentRole & Context Builder Tests

  • Implementer context includes full task spec + write instructions
  • Reviewer context includes diff + acceptance criteria + verdict format
  • Validator context includes test/lint instructions
  • Revision context includes review comments from previous cycle
  • ChatMessageContext carries role and previous phase output correctly

MultiAgentPhaseManager Tests

  • SINGLE mode: one phase, immediate completion
  • IMPLEMENTER_REVIEWER: two phases (implement → review), APPROVE → complete
  • IMPLEMENTER_REVIEWER: REQUEST_CHANGES → revision → re-review cycle
  • IMPLEMENTER_REVIEWER: max revisions exhausted → task marked for manual review
  • VERIFY_ONLY: skips implementation, runs validation only
  • Phase failure propagates correctly to runner

DiffCaptureService Tests

  • Baseline captured correctly (git rev-parse HEAD)
  • Diff captured between baseline and working tree
  • Changed files list matches actual modifications
  • Large diff truncated with summary
  • Non-git project fallback works

ReviewVerdictParser Tests

  • Structured APPROVE verdict parsed correctly
  • Structured REQUEST_CHANGES with comments parsed correctly
  • Fallback heuristic detects "approve" keyword
  • Fallback heuristic detects "changes needed" / "reject" keywords
  • Malformed output defaults to REQUEST_CHANGES (conservative)
  • Empty output handled gracefully

Role-Based CLI Dispatch Tests

  • Different tools selected for implementer vs. reviewer
  • Default: same tool for all roles
  • Tool config correctly passed to each phase execution

Files to Create

  • src/test/java/com/devoxx/genie/service/spec/MultiAgentPhaseManagerTest.java (new)
  • src/test/java/com/devoxx/genie/service/spec/DiffCaptureServiceTest.java (new)
  • src/test/java/com/devoxx/genie/service/spec/ReviewVerdictParserTest.java (new)
  • src/test/java/com/devoxx/genie/service/spec/AgentRoleContextTest.java (new)

Dependencies

Acceptance Criteria

  • All test cases above pass
  • No flaky tests
  • Existing tests unaffected
  • SINGLE mode regression tests confirm zero behavior change

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions