This directory contains the source and infrastructure code for running multi-language integration tests in AWS.
This repository contains example code written in 11 of the AWS-supported Software Development Kit (SDK) languages. This code must be tested to ensure its accuracy and functionality over time. However, while this repository contains comprehensive test coverage, each test must be manually triggered and can take many hours to complete.
This solution offers centralized triggering and language-agnostic test orchestration. In exchange, it requires "automation-friendly" tests and the deployment of the following AWS Cloud Development Kit (AWS CDK) stacks.
The following design features make this tool easy to use:
- Serverless - Requires no stateful infrastructure
- No pipeline - Relies on events, not manual interaction
- All code - The entire solution is deployable by using the AWS CDK
In addition to the source code in this repository, this solution consists of the following CDK stacks:
Stack | Function | Purpose |
---|---|---|
Public Images | Holds versions of language-specialized Docker images. | Event-based production of ready-to-run Docker images for each supported SDK. |
Producer | Publishes a scheduled message to an Amazon Simple Notification Service (Amazon SNS) topic. | Centralized cron-based triggering of integration tests. |
Consumer | Consumes a message to trigger integration tests on AWS Batch with AWS Fargate. | Federated integration testing of example code for each supported SDK. |
The following diagram shows the behavior of this GitHub repository and the preceding stacks:
On the surface, this solution orchestrates the execution of distributed integration testing for the 11 supported SDKs. Under the hood, it relies on the source code in this repository and the following CDK stacks.
Image repositories are managed from an AWS account in which the Public images stack is deployed.
Through a secure integration, a GitHub Workflow configured in this repository produces Docker images containing pre-built SDK code and publishes them to the AWS SDK Code Examples Images public registry.
See CDK stack.
Events are emitted from an AWS account in which the Producer Stack is deployed.
This stack contains a cron-based Amazon EventBridge rule that writes to a singular SNS topic. Through a cross-account integration, Amazon Simple Queue Service (Amazon SQS) queues in different AWS accounts can subscribe to this topic.
See CDK stack.
Testing is performed in AWS accounts in which the Consumer Stack is deployed.
This stack contains an AWS Lambda function that submits jobs to AWS Batch. Through a secure integration, this Lambda function is triggered by an SQS queue that's subscribed to a cross-account topic.
See CDK stack.