Skip to content

Add unit tests for HarnessDeployer #1381

@jariy17

Description

@jariy17

Problem

src/cli/operations/deploy/imperative/deployers/harness-deployer.ts (370 lines) has zero unit tests. It contains retry logic, polling, role resolution, create/update/delete branching, and error handling — all untested.

harness-mapper.test.ts covers the mapping layer but not the deployer orchestration.

What to test

  • createWithRetry — IAM role propagation retry behavior, max retries exhausted
  • waitForReady — polling success, timeout, FAILED terminal state
  • deploy() — create vs update branching based on existing state, partial failure handling, deletion of removed harnesses
  • teardown — reverse-order cleanup, error propagation
  • resolveRoleArn — CDK output key matching (both old and new construct layouts)

Context

Found during review of #1341.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions