This repository contains the performance test framework for testing Digital Identity happy path user journeys.
- pre-commit for running pre-commit hooks locally
% brew install pre-commit && pre-commit install && pre-commit install -tprepare-commit-msg -tcommit-msg
- k6 for testing and executing scripts locally
% brew install k6
- AWS CLI for command line access to AWS resources
- AWS SAM CLI only needed for platform engineers managing the serverless resources and pipelines
% brew install aws/tap/aws-sam-cli
- GDS CLI for command line access to internal AWS accounts and resources
% brew install alphagov/gds/gds-cli
- Docker for building or testing the Dockerfile locally
If you would like to create a new test script or make changes to any of the existing test scripts, first read through the information in deploy/scripts/README.md
. Create a new .ts
file in the appropriate team folder within the deploy/scripts
directory or change an existing one.
Raise pull requests for any changes, including the JIRA ticket number in the description. Pull requests must pass pre-commit hooks, linting and unit test checks before merging to main.
The infrastructure is defined as infrastructure-as-code in the form of a AWS CloudFormation template. This defines the performance test application stack which consists of a AWS CodeBuild pipeline which orchestrates the performance tests.
The CodeBuild agent uses a Docker image, which is defined in the Dockerfile. The image contains:
- k6 - which is used as the load injector application
- OpenTelemetry Collector - which uses the configuration template to send statsd metrics from k6 and host metrics from the CodeBuild agent to Dynatrace
- Test data and scripts - Scripts are written in TypeScript and transpiled into JavaScript by esbuild
The performance test application is initially deployed to the di-performance-test-non-prod
AWS account and then promoted to the di-performance-test-prod
account. From the Production account, performance tests can be run against any given Build or Staging environment.