Skip to content

[FEAT] Add integration tests against DynamoDB Local for AWS templates #55

@colbytimm

Description

@colbytimm

Summary

Once AWS Lambda templates exist (depends on issues #49, #50, #51, #52), add integration tests that run against DynamoDB Local in CI. DynamoDB Local is a lightweight Docker image provided by Amazon that supports the full DynamoDB API. This validates the DynamoDB repository code works against a real DynamoDB-compatible API.

Category: testing, aws

Depends on: #49, #50, #51, #52 (AWS Lambda template implementations)

Acceptance Criteria

  • GHA workflow for each language adds a test-integration-aws job
  • DynamoDB Local (amazon/dynamodb-local) runs as a Docker service container
  • AWS_ENDPOINT_URL (or SDK-specific endpoint override) points the SDK at the local instance
  • Integration tests for each template:
    • Create the DynamoDB table with correct key schema as test setup
    • Run all 5 CRUD operations (create, get by ID, list, update, soft-delete)
    • Assert correct item structure and attribute values
    • Clean up the table in teardown
  • Makefile adds test-integration target
  • Tests are AWS-variant only

Implementation Notes

DynamoDB Local in GHA

services:
  dynamodb:
    image: amazon/dynamodb-local:latest
    ports:
      - 8000:8000

Connection details:

  • Endpoint: http://localhost:8000
  • Region: Any valid region string (e.g., us-east-1)
  • Credentials: Any non-empty string (DynamoDB Local doesn't validate)

Table Schema

The integration tests should create a table matching the template's expected schema:

Table Name: from DYNAMODB_TABLE_NAME env var
Partition Key: id (String)

SDK Endpoint Override per Language

  • Python (boto3): endpoint_url="http://localhost:8000" in client constructor
  • TypeScript (AWS SDK v3): endpoint: "http://localhost:8000" in DynamoDBClient config
  • Go (aws-sdk-go-v2): aws.EndpointResolverWithOptionsFunc or BaseEndpoint
  • .NET (AWSSDK): ServiceURL = "http://localhost:8000" in AmazonDynamoDBConfig

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions