Skip to content

Commit 47357ba

Browse files
authored
Merge pull request #70 from aws-solutions/develop
Update to version v2.0.1
2 parents 494abcb + f989c9f commit 47357ba

35 files changed

+572
-335
lines changed

CHANGELOG.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
# Change Log
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.0.1] - 2021-12-13
9+
10+
Version 2.0.1 supports upgrading from version 2.0.0 but not from version 1.3.0 and below
11+
12+
> **Note**: When upgrading from version 2.0.0 to 2.0.1, make sure to clear CloudFront and browser cache to avoid image issues.
13+
14+
### Changed
15+
16+
- Updated AWS SDK version in development dependencies for AWS Lambda functions
17+
- Bug fix to resolve issue with displaying a large number of tests
18+
- Bug fix for error _finalResults function error ValidationException: Item size to update has exceeded the maximum allowed size_
19+
- Merge [#64](https://github.com/aws-solutions/distributed-load-testing-on-aws/pull/64) from [@rmdashrfslash](https://github.com/rmdashrfslash)
20+
621
## [2.0.0] - 2021-09-30
22+
723
⚠ BREAKING CHANGES
824
Version 2.0.0 does not support upgrading from previous versions.
25+
926
### Added
27+
1028
- Support to view complete data from previous test runs, including test configuration, test data, and Amazon CloudWatch dashboards
1129
- Results History now has a `View details` link to display data from previous test runs
1230
- Support for an existing Amazon VPC
1331
- Launch Fargate tasks in multiple availability zones
1432
- Using AWS CDK source code to generate the AWS CloudFormation template
1533

1634
### Changed
35+
1736
- Results History displays:
1837
- Run Time
1938
- Task Count
@@ -24,12 +43,15 @@ Version 2.0.0 does not support upgrading from previous versions.
2443
- Test ids only contain alphanumeric characters
2544

2645
### Removed
46+
2747
- Remove AWS CodePipeline, AWS CodeBuild, and Amazon ECR image repository resource creation by AWS CloudFormation stack
2848
- The solution's container image is stored in a public ECR image repository managed by AWS
2949
- Remove `ECRChecker` lambda function and state machine stage
3050

3151
## [1.3.0] - 2021-04-30
52+
3253
### Added
54+
3355
- Support for up to 1000 tasks
3456
- Added TaskCanceler lambda to cancel tasks
3557
- Added steps in step function to support launching 1000 tasks
@@ -56,7 +78,8 @@ Version 2.0.0 does not support upgrading from previous versions.
5678
- Added SolutionId and TestId tag to Fargate tasks and SolutionId tag to API Gateway
5779

5880
### Changed
59-
- Merge [#50](https://github.com/awslabs/distributed-load-testing-on-aws/pull/50/) by [@naxxster](https://github.com/naxxster)
81+
82+
- Merge [#50](https://github.com/aws-solutions/distributed-load-testing-on-aws/pull/50/) by [@naxxster](https://github.com/naxxster)
6083
- Increased Task Count limits
6184
- Changed ETA for running tasks to be dynamic based on number of tasks
6285
- Increased task cpu and memory to handle increased cpu load
@@ -69,11 +92,14 @@ Version 2.0.0 does not support upgrading from previous versions.
6992
- Changed concurrency message to provide guidelines to determine max concurrency
7093

7194
### Removed
95+
7296
- Concurrency Limits
7397
- Removed aggregated CloudWatch dashboard and metric
7498

7599
## [1.2.0] - 2020-12-17
100+
76101
### Added
102+
77103
- JMeter input file support and plugins support
78104
- JMeter input files should be zipped with the JMeter script file.
79105
- Add `jetty-*.jar` files to the Amazon ECR to support JMeter HTTP/2 plugin:
@@ -98,6 +124,7 @@ Version 2.0.0 does not support upgrading from previous versions.
98124
- When there is no result in the S3 bucket, it regards the result as `FAILED`.
99125

100126
### Changed
127+
101128
- Use `Promise.all()` in `results-parser` to improve the performance
102129
- Correct average bandwidth on the Detail page
103130
- Packages version
@@ -106,26 +133,32 @@ Version 2.0.0 does not support upgrading from previous versions.
106133
- Maximum upload file size to 50MB to support JMeter input files
107134

108135
## [1.1.0] - 2020-09-30
136+
109137
### Added
110-
- JMeter support with `jmx` script: [#3](https://github.com/awslabs/distributed-load-testing-on-aws/issues/3)
138+
139+
- JMeter support with `jmx` script: [#3](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/3)
111140
- Add `START` button on details page
112141
- Add `CANCEL` button on create page
113142
- Add AWS Step Functions to run tasks and update result instead of Amazon DynamoDB and Amazon SQS
114143
- Add `BucketEncryption` for `ConsoleBucket`
115144
- Add API Gateway logging
116145

117146
### Changed
118-
- Merge [#15](https://github.com/awslabs/distributed-load-testing-on-aws/pull/15/) by [@afittz](https://github.com/afittz)
119-
- Merge [#16](https://github.com/awslabs/distributed-load-testing-on-aws/pull/16/) by [@Patrick-56Bit](https://github.com/Patrick-56Bit)
147+
148+
- Merge [#15](https://github.com/aws-solutions/distributed-load-testing-on-aws/pull/15/) by [@afittz](https://github.com/afittz)
149+
- Merge [#16](https://github.com/aws-solutions/distributed-load-testing-on-aws/pull/16/) by [@Patrick-56Bit](https://github.com/Patrick-56Bit)
120150
- Change `LAST RAN` to `STARTED AT` and add `ENDED AT` information when test is completed
121151
- Change CodeBuild image to `aws/codebuild/standard:4.0`
122152
- Update Node.js version from 10.x to 12.x
123153
- All Amazon S3 buckets do not allow public access.
124154

125155
### Removed
156+
126157
- Amazon SQS queue
127158
- Amazon DynamoDB Results table
128159

129160
## [1.0.0] - 2019-11-14
161+
130162
### Added
131-
- CHANGELOG version 1.0.0 release
163+
164+
- CHANGELOG version 1.0.0 release

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ information to effectively respond to your bug report or contribution.
1111

1212
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313

14-
When filing an issue, please check [existing open](https://github.com/awslabs/distributed-load-testing-on-aws/issues), or [recently closed](https://github.com/awslabs/distributed-load-testing-on-aws/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
14+
When filing an issue, please check [existing open](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues), or [recently closed](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
1515
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616

1717
* A reproducible test case or series of steps
@@ -41,7 +41,7 @@ GitHub provides additional document on [forking a repository](https://help.githu
4141

4242

4343
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/distributed-load-testing-on-aws/labels/help%20wanted) issues is a great place to start.
44+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-solutions/distributed-load-testing-on-aws/labels/help%20wanted) issues is a great place to start.
4545

4646

4747
## Code of Conduct
@@ -56,6 +56,6 @@ If you discover a potential security issue in this project we ask that you notif
5656

5757
## Licensing
5858

59-
See the [LICENSE](https://github.com/awslabs/distributed-load-testing-on-aws/blob/master/LICENSE.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
59+
See the [LICENSE](https://github.com/aws-solutions/distributed-load-testing-on-aws/blob/master/LICENSE.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
6060

6161
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

README.md

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
The Distributed Load Testing Solution leverages managed, highly available and highly scalable AWS services to effortlessly create and simulate thousands of connected users generating a selected amount of transactions per second. As a result, developers can understand the behavior of their applications at scale and at load to identify any bottleneck problems before they deploy to Production.
44

5-
65
## On this Page
6+
77
- [Architecture Overview](#architecture-overview)
88
- [Deployment](#deployment)
99
- [Source Code](#source-code)
10-
- [Creating a custom build](#additional-resources)
11-
10+
- [Creating a custom build](#creating-a-custom-build)
1211

1312
## Architecture Overview
13+
1414
![Architecture](architecture.png)
1515

1616
## Deployment
17+
1718
The solution is deployed using a CloudFormation template with a lambda backed custom resource. For details on deploying the solution please see the details on the solution home page: [Distributed Load Testing](https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws/)
1819

1920
## Source Code
@@ -40,65 +41,67 @@ A NodeJS Lambda function that runs the Amazon ECS task definition for each test.
4041
A NodeJS Lambda function that checks if the Amazon ECS tasks are running or not.
4142

4243
## Creating a custom build
44+
4345
The solution can be deployed through the CloudFormation template available on the solution home page: [Distributed Load Testing](https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws/).
44-
To make changes to the solution, download or clone this repo, update the source code and then run the deployment/build-s3-dist.sh script to deploy the updated Lambda code to an Amazon S3 bucket in your account.
4546

46-
### Prerequisites:
47-
* [AWS Command Line Interface](https://aws.amazon.com/cli/)
47+
To make changes to the solution, download or clone this repository, update the source code and then run the deployment/build-s3-dist.sh script to deploy the updated Lambda code to an Amazon S3 bucket in your account.
48+
49+
### Prerequisites
50+
4851
* Node.js 14.x or later
4952

50-
### 1. Clone the Distributed Load Testing on AWS solution repository
51-
Clone the ```distributed-load-testing-on-aws``` GitHub repository, then make the desired code changes.
53+
### Running unit tests for customization
54+
55+
* Clone the repository and make the desired code changes.
5256

5357
```bash
54-
git clone https://github.com/awslabs/distributed-load-testing-on-aws.git
58+
git clone https://github.com/aws-solutions/distributed-load-testing-on-aws.git
59+
cd distributed-load-testing-on-aws
60+
export BASE_DIRECTORY=$PWD
5561
```
5662

57-
### 2. Run unit tests
58-
Run unit tests to make sure added customization passes the tests:
63+
* Run unit tests to make sure the updates pass the tests.
64+
5965
```bash
60-
cd ./deployment
66+
cd $BASE_DIRECTORY/deployment
6167
chmod +x ./run-unit-tests.sh
6268
./run-unit-tests.sh
6369
```
6470

65-
### 3. Declare environment variables
71+
### Building distributable for customization
72+
73+
* Configure the environment variables.
74+
6675
```bash
67-
export REGION=aws-region-code # the AWS region to launch the solution (e.g. us-east-1)
68-
export DIST_OUTPUT_BUCKET=my-bucket-name # bucket where customized code will reside
76+
export DIST_BUCKET_PREFIX=my-bucket-name # bucket where customized code will reside
6977
export SOLUTION_NAME=my-solution-name
7078
export VERSION=my-version # version number for the customized code
79+
export REGION=aws-region-code # the AWS region to launch the solution (e.g. us-east-1)
7180
export PUBLIC_ECR_REGISTRY=public.ecr.aws/awssolutions/distributed-load-testing-on-aws-load-tester # replace with the container registry and image if you want to use a different container image
7281
export PUBLIC_ECR_TAG=v2.0 # replace with the container image tag if you want to use a different container image
7382
```
7483

75-
### 4. Create an Amazon S3 Bucket
76-
The CloudFormation template is configured to pull the Lambda deployment packages from Amazon S3 bucket in the region the template is being launched in. Create a bucket in the desired region with the region name appended to the name of the bucket. eg: for us-east-1 create a bucket named: ```my-bucket-us-east-1```
77-
```bash
78-
aws s3 mb s3://$DIST_OUTPUT_BUCKET-$REGION --region $REGION
79-
```
84+
> **Note:** When you define `DIST_BUCKET_PREFIX`, a randomized value is recommended. You will need to create an S3 bucket where the name is `<DIST_BUCKET_PREFIX>-<REGION>`. The solution's CloudFormation template will expect the source code to be located in a bucket matching that name.
85+
86+
* Build the distributable.
8087

81-
### 5. Create the deployment packages
82-
Build the distributable:
8388
```bash
89+
cd $BASE_DIRECTORY/deployment
8490
chmod +x ./build-s3-dist.sh
85-
./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $VERSION
91+
./build-s3-dist.sh $DIST_BUCKET_PREFIX $SOLUTION_NAME $VERSION
8692
```
8793

88-
> **Notes**: The _build-s3-dist_ script expects the bucket name as one of its parameters, and this value should not include the region suffix. In addition to that, the version parameter will be used to tag the npm packages, and therefore should be in the [Semantic Versioning format](https://semver.org/spec/v2.0.0.html).
94+
> **Note**: The _build-s3-dist_ script expects the bucket name as one of its parameters, and this value should not include the region suffix. In addition to that, the version parameter will be used to tag the npm packages, and therefore should be in the [Semantic Versioning format](https://semver.org/spec/v2.0.0.html).
8995
90-
### 6. Upload deployment assets to your Amazon S3 bucket
91-
Deploy the distributable to the Amazon S3 bucket in your account:
92-
```bash
93-
aws s3 cp ./regional-s3-assets/ s3://$DIST_OUTPUT_BUCKET-$REGION/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control
94-
aws s3 cp ./global-s3-assets/ s3://$DIST_OUTPUT_BUCKET-$REGION/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control
95-
```
96+
* Deploy the distributable to the Amazon S3 bucket in your account.
9697

97-
### 7. Launch the CloudFormation template.
98-
* Get the link of the `distributed-load-testing-on-aws.template` uploaded to your Amazon S3 bucket.
99-
* Deploy the Distributed Load Testing on AWS solution to your account by launching a new AWS CloudFormation stack using the link of the `distributed-load-testing-on-aws.template`.
98+
* Make sure you are uploading the distributable to the `<DIST_BUCKET_PREFIX>-<REGION>` bucket.
99+
* Get the link of the solution template uploaded to your Amazon S3 bucket.
100+
101+
* Deploy the solution to your account by launching a new AWS CloudFormation stack using the link of the solution template in Amazon S3.
100102

101103
## Creating a custom container build
104+
102105
This solution uses a public Amazon Elastic Container Registry (Amazon ECR) image repository managed by AWS to store the solution container image that is used to run the configured tests. If you want to customize the container image, you can rebuild and push the image into an ECR image repository in your own AWS account.
103106
For details on how to customize the container image, please see the **Container image customization** section of the [implementation guide](https://docs.aws.amazon.com/solutions/latest/distributed-load-testing-on-aws/container-image.html).
104107

deployment/run-unit-tests.sh

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,81 @@
11
#!/bin/bash
2+
#
3+
# This script runs all tests for the root CDK project, as well as any microservices, Lambda functions, or dependency
4+
# source code packages. These include unit tests and snapshot tests.
5+
#
6+
# The if/then blocks are for error handling. They will cause the script to stop executing if an error is thrown from the
7+
# node process running the test case(s). Removing them or not using them for additional calls with result in the
8+
# script continuing to execute despite an error being thrown.
29

3-
source_dir="$PWD/../source"
10+
[ "$DEBUG" == 'true' ] && set -x
11+
set -e
412

5-
cd $source_dir/api-services
6-
npm install --silent
7-
npm test
813

9-
cd $source_dir/custom-resource
10-
npm install --silent
11-
npm test
14+
prepare_jest_coverage_report() {
15+
local component_name=$1
1216

13-
cd $source_dir/results-parser
14-
npm install --silent
15-
npm test
17+
if [ ! -d "coverage" ]; then
18+
echo "ValidationError: Missing required directory coverage after running unit tests"
19+
exit 129
20+
fi
1621

17-
cd $source_dir/task-runner
18-
npm install --silent
19-
npm test
22+
# prepare coverage reports
23+
rm -fr coverage/lcov-report
24+
mkdir -p $coverage_reports_top_path/jest
25+
coverage_report_path=$coverage_reports_top_path/jest/$component_name
26+
rm -fr $coverage_report_path
27+
mv coverage $coverage_report_path
28+
}
2029

21-
cd $source_dir/task-status-checker
22-
npm install --silent
23-
npm test
30+
run_tests() {
31+
local component_path=$1
32+
local component_name=$2
2433

25-
cd $source_dir/task-canceler
26-
npm install --silent
27-
npm test
34+
echo "------------------------------------------------------------------------------"
35+
echo "[Test] Run unit test with coverage for $component_name"
36+
echo "------------------------------------------------------------------------------"
37+
echo "cd $component_path"
38+
cd $component_path
2839

29-
cd $source_dir/infrastructure
30-
npm install --silent
31-
npm test
40+
# install dependencies
41+
npm run clean
42+
npm install
43+
44+
# run unit tests
45+
npm test
46+
47+
# prepare coverage reports
48+
prepare_jest_coverage_report $component_name
49+
}
50+
51+
# Run unit tests
52+
echo "Running unit tests"
53+
54+
# Get reference for source folder
55+
source_dir="$(cd $PWD/../source; pwd -P)"
56+
coverage_reports_top_path=$source_dir/test/coverage-reports
57+
58+
# Test packages
59+
declare -a packages=(
60+
"api-services"
61+
"custom-resource"
62+
"infrastructure"
63+
"results-parser"
64+
"task-canceler"
65+
"task-runner"
66+
"task-status-checker"
67+
)
68+
69+
for package in "${packages[@]}"; do
70+
run_tests $source_dir/$package $package
71+
# Check the result of the test and exit if a failure is identified
72+
if [ $? -eq 0 ]
73+
then
74+
echo "Test for $package passed"
75+
else
76+
echo "******************************************************************************"
77+
echo "Test FAILED for $package"
78+
echo "******************************************************************************"
79+
exit 1
80+
fi
81+
done

0 commit comments

Comments
 (0)