Skip to content

tech debt: unit tests attach HttpBackend directly instead of AwsStack gridBackendConfig #143

Description

@so0k

Pattern divergence in unit-test backend setup

The repo convention for snapshotted unit-test stacks is to pass gridBackendConfig: { address: "http://localhost:3000" } to the AwsStack constructor (see test/aws/encryption/secret.test.ts). Both routes exist because the PR #118-era fix for machine-dependent tfstate paths in snapshots was applied as new HttpBackend(stack, ...) in the conversion-series suites.

Current census: 50 test files use gridBackendConfig (canonical), 41 use new HttpBackend directly (tech debt, listed below). Synth output is identical, so migrating is a mechanical no-snapshot-churn change per file.

Files to migrate

  • test/aws/compute/auto-scaling/aspects/require-imdsv2-aspect.test.ts
  • test/aws/compute/auto-scaling/cfn-init.test.ts
  • test/aws/compute/auto-scaling/lifecyclehooks.test.ts
  • test/aws/compute/auto-scaling/scheduled-action.test.ts
  • test/aws/compute/auto-scaling/warm-pool.test.ts
  • test/aws/compute/batch/ecs-container-definition.test.ts
  • test/aws/compute/batch/ecs-job-definition.test.ts
  • test/aws/compute/batch/job-queue.test.ts
  • test/aws/compute/batch/managed-compute-environment.test.ts
  • test/aws/compute/batch/multinode-job-definition.test.ts
  • test/aws/compute/batch/scheduling-policy.test.ts
  • test/aws/compute/ecs/alternate-target-configuration.test.ts
  • test/aws/compute/ecs/amis.test.ts
  • test/aws/compute/ecs/app-mesh-proxy-configuration.test.ts
  • test/aws/compute/ecs/aws-log-driver.test.ts
  • test/aws/compute/ecs/base-service.test.ts
  • test/aws/compute/ecs/container-definition.test.ts
  • test/aws/compute/ecs/ec2/ec2-service.test.ts
  • test/aws/compute/ecs/ec2/ec2-task-definition.test.ts
  • test/aws/compute/ecs/environment-file.test.ts
  • test/aws/compute/ecs/external/external-service.test.ts
  • test/aws/compute/ecs/external/external-task-definition.test.ts
  • test/aws/compute/ecs/fargate/fargate-service.test.ts
  • test/aws/compute/ecs/fargate/fargate-task-definition.test.ts
  • test/aws/compute/ecs/firelens-log-driver.test.ts
  • test/aws/compute/ecs/gelf-log-driver.test.ts
  • test/aws/compute/ecs/images/tag-parameter-container-image.test.ts
  • test/aws/compute/ecs/journald-log-driver.test.ts
  • test/aws/compute/ecs/json-file-log-driver.test.ts
  • test/aws/compute/ecs/syslog-log-driver.test.ts
  • test/aws/compute/ecs/task-definition.test.ts
  • test/aws/compute/tasks/batch/submit-job.test.ts
  • test/aws/edge/cloudmap/instance.test.ts
  • test/aws/edge/cloudmap/namespace.test.ts
  • test/aws/edge/cloudmap/service.test.ts
  • test/aws/edge/distribution.test.ts
  • test/aws/encryption/policy.test.ts
  • test/aws/encryption/rotation-schedule.test.ts
  • test/aws/storage/bucket.test.ts
  • test/aws/storage/notification.test.ts

Acceptance

  • All listed files construct their stacks with gridBackendConfig and drop the HttpBackend import.
  • grep -rl "new HttpBackend" test --include="*.test.ts" returns empty.
  • No snapshot changes (identical backend JSON) — any churn indicates a mistake.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions