Skip to content

test(batch): cover ContainerImage.fromAsset ECR image assets #141

Description

@sakul-learning

Gap

The AWS Batch port accepts ecs.ContainerImage, and the shared API already exposes ContainerImage.fromAsset(). However, the equivalent Batch coverage remains commented out because the upstream test/batchjob-image/ Dockerfile fixture was not ported.

This leaves the local-Docker-context → staging → Docker build → ECR image URI → Batch containerProperties.image path unverified for Batch, even though the TerraConstructs implementation is intended to support it. fromRegistry() and fromEcrRepository() coverage do not exercise that path.

Related: #136 (Batch port). This is distinct from #124 / the pending CDKTN 0.24 asset-pipeline release: #124 changes the generic staging implementation, but does not add the ECR publishing behavior.

Scope

  1. Port or add the Batch batchjob-image/ Docker build-context fixture (including its Dockerfile) from the relevant upstream AWS CDK test coverage.
  2. Restore or replace the commented ContainerImage.fromAsset(path.join(__dirname, "batchjob-image")) synthesis test for an ECS Batch job definition.
  3. Assert the synthesized Batch containerProperties.image is wired to the Docker image asset/ECR URI—not merely a registry literal—and retain assertions appropriate for the asset dependency.
  4. Run a targeted live Batch deployment: build/publish the image asset, submit/run the Batch workload, verify successful completion/log output, and destroy the test resources. Capture the result in the PR.

Timing / dependency

If #124 lands, run this coverage against its CDKTN-backed staging path. #124 itself must wait for the CDKTN 0.24 release line; this issue tracks the missing Batch-specific fixture and evidence independently.

Acceptance criteria

  • Version-controlled fixture exists and is used by a non-commented synthesis/integration test.
  • The test exercises ecs.ContainerImage.fromAsset() for batch.EcsJobDefinition.
  • The test proves the rendered Batch image is the generated ECR asset image URI.
  • Targeted live deploy → Batch execution → verification → destroy evidence is attached to the implementing PR.

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