Skip to content

Commit 738cba4

Browse files
committed
update to version v3.2.0
1 parent a94bb12 commit 738cba4

File tree

117 files changed

+10056
-7462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+10056
-7462
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.2.0] - 2022-03-09
9+
10+
### Added
11+
12+
- Task limits based on on-demand vCPU quotas for the account along with currently running Fargate tasks.
13+
- Table to the console when creating a test to visualize available Fargate quotas.
14+
- Auto-refresh functionality
15+
- eslint and prettier formatting
16+
17+
### Fixed
18+
19+
- Bug fix for [#115](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/115) where Step Functions hits a task execution limit.
20+
- Bug fix for [#115](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/115) where test does not cancel properly.
21+
- CloudWatch Dashboards link in console
22+
- Deletion of CloudWatch Dashboards on test deletion
23+
24+
### Security
25+
26+
- Updated to bootstrap 5
27+
- Updated to blazemeter/taurus version 1.16.9
28+
829
## [3.1.1] - 2022-11-18
930

1031
### Fixed

NOTICE.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This software includes third party software subject to the following copyrights:
1313
@aws-solutions-constructs/aws-cloudfront-s3 under the Apache License 2.0
1414
@types/jest under the Massachusetts Institute of Technology (MIT) License
1515
@types/node under the Massachusetts Institute of Technology (MIT) License
16+
@typescript-eslint/eslint-plugin under the Massachusetts Institute of Technology (MIT) license
17+
@typescript-eslint/parser under the BSD 2-Clause license
1618
aws-amplify under the Apache License Version 2.0
1719
aws-cdk under the Apache License Version 2.0
1820
aws-cdk-lib under the Apache License 2.0
@@ -25,6 +27,15 @@ brace under the Massachusetts Institute of Technology (MIT) license
2527
chart.js under the Massachusetts Institute of Technology (MIT) license
2628
chartjs-adapter-moment under the Massachusetts Institute of Technology (MIT) license
2729
constructs under the Apache License 2.0
30+
eslint under the Massachusetts Institute of Technology (MIT) license
31+
eslint-config-prettier under the Massachusetts Institute of Technology (MIT) license
32+
eslint-config-standard under the Massachusetts Institute of Technology (MIT) license
33+
eslint-plugin-header under the Massachusetts Institute of Technology (MIT) license
34+
eslint-plugin-import under the Massachusetts Institute of Technology (MIT) license
35+
eslint-plugin-jsdoc under the BSD 2-Clause license
36+
eslint-plugin-node under the Massachusetts Institute of Technology (MIT) license
37+
eslint-plugin-prettier under the Massachusetts Institute of Technology (MIT) license
38+
eslint-plugin-react under the Massachusetts Institute of Technology (MIT) license
2839
false under the Apache License Version 2.0
2940
jest under the Massachusetts Institute of Technology (MIT) license
3041
jetty-alpn-client under the Apache License Version 2.0 and the Eclipse Public License 1.0
@@ -35,6 +46,7 @@ jetty-io under the Apache License Version 2.0 and the Eclipse Public License 1.0
3546
jetty-util under the Apache License Version 2.0 and the Eclipse Public License 1.0
3647
js-yaml under the Massachusetts Institute of Technology (MIT) license
3748
moment under the Massachusetts Institute of Technology (MIT) license
49+
prettier under the Massachusetts Institute of Technology (MIT) license
3850
react under the Massachusetts Institute of Technology (MIT) license
3951
react-ace under the Massachusetts Institute of Technology (MIT) license
4052
react-dom under the Massachusetts Institute of Technology (MIT) license

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To make changes to the solution, download or clone this repository, update the s
5959

6060
### Prerequisites
6161

62-
- Node.js 14.x or later
62+
- Node.js 16.x or later
6363
- S3 bucket that includes the AWS region as a suffix in the name. For example, `my-bucket-us-east-1`. The bucket and CloudFormation stack must be in the same region. The solution's CloudFormation template will expect the source code to be located in a bucket matching that name.
6464

6565
### Running unit tests for customization
@@ -91,7 +91,7 @@ export BUCKET_NAME=$BUCKET_PREFIX-$REGION # full bucket name where the code will
9191
export SOLUTION_NAME=my-solution-name
9292
export VERSION=my-version # version number for the customized code
9393
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
94-
export PUBLIC_ECR_TAG=v3.0.0 # replace with the container image tag if you want to use a different container image
94+
export PUBLIC_ECR_TAG=v3.2.0 # replace with the container image tag if you want to use a different container image
9595
```
9696

9797
- Build the distributable.

deployment/build-s3-dist.sh

100644100755
File mode changed.

deployment/ecr/distributed-load-testing-on-aws-load-tester/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM blazemeter/taurus:1.16.11
1+
FROM blazemeter/taurus:1.16.19
22
# taurus includes python and pip
33
RUN /usr/bin/python3 -m pip install --upgrade pip
44
RUN pip install --no-cache-dir awscli

deployment/run-unit-tests.sh

100644100755
Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,59 @@ run_tests() {
3737
echo "cd $component_path"
3838
cd $component_path
3939

40-
# install dependencies
41-
npm run clean
42-
npm install
43-
4440
# run unit tests
4541
npm test
4642

4743
# prepare coverage reports
4844
prepare_jest_coverage_report $component_name
49-
rm -rf coverage node_modules package-lock.json
50-
}
5145

52-
# Run unit tests
53-
echo "Running unit tests"
46+
if [ $component_name = "solution-utils" ]
47+
then
48+
rm -rf coverage package-lock.json
49+
else
50+
rm -rf coverage node_modules package-lock.json
51+
fi
52+
}
5453

5554
# Get reference for source folder
5655
source_dir="$(cd $PWD/../source; pwd -P)"
5756
coverage_reports_top_path=$source_dir/test/coverage-reports
5857

58+
#install dependencies
59+
cd $source_dir
60+
npm run clean:all
61+
npm run install:all
62+
63+
#run prettier
64+
echo "Running prettier formatting check"
65+
npm run prettier-check
66+
if [ $? -eq 0 ]
67+
then
68+
echo "Formatting check passed"
69+
else
70+
echo "******************************************************************************"
71+
echo "Test FAILED formatting check, run prettier-formatting on code"
72+
echo "******************************************************************************"
73+
exit 1
74+
fi
75+
76+
#run linting check
77+
echo "Running linting check"
78+
npm run lint
79+
if [ $? -eq 0 ]
80+
then
81+
echo "Formatting check passed"
82+
else
83+
echo "******************************************************************************"
84+
echo "Test FAILED linting check, run eslint on code and fix corresponding issues"
85+
echo "******************************************************************************"
86+
exit 1
87+
fi
88+
npm run clean
89+
90+
# Run unit tests
91+
echo "Running unit tests"
92+
5993
# Test packages
6094
declare -a packages=(
6195
"solution-utils"

source/.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/infrastructure/*.js
2+
*.d.ts
3+
node_modules
4+
coverage
5+
**/test/*
6+
**/build/*
7+
**/assets/*

source/.eslintrc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"root": true,
3+
"extends": ["eslint:recommended"],
4+
"env": {
5+
"jest": true,
6+
"node": true,
7+
"es6": true
8+
},
9+
"ignorePatterns": ["**/node_modules/**"],
10+
"parserOptions": {
11+
"ecmaVersion": "latest"
12+
},
13+
"overrides": [
14+
{
15+
"files": ["**/*.ts", "**/*.tsx"],
16+
"plugins": ["@typescript-eslint", "import", "header"],
17+
"extends": [
18+
"eslint:recommended",
19+
"plugin:@typescript-eslint/recommended",
20+
"plugin:import/recommended",
21+
"plugin:import/typescript",
22+
"standard",
23+
"plugin:jsdoc/recommended",
24+
"plugin:prettier/recommended"
25+
],
26+
"parser": "@typescript-eslint/parser",
27+
"parserOptions": {
28+
"ecmaVersion": "latest",
29+
"sourceType": "module",
30+
"project": "**/tsconfig.json"
31+
},
32+
"rules": {
33+
"@typescript-eslint/no-inferrable-types": ["off", { "ignoreParameters": true, "ignoreProperties": true }],
34+
"@typescript-eslint/no-useless-constructor": ["off"],
35+
"@typescript-eslint/no-unused-vars": ["error", { "args": "none", "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
36+
"@typescript-eslint/no-throw-literal": ["error"],
37+
"no-new": 0
38+
}
39+
},
40+
{
41+
"files": ["**/console/*.js"],
42+
"extends": ["eslint:recommended", "plugin:react/recommended"],
43+
"plugins": ["react"]
44+
}
45+
],
46+
"rules": {
47+
"arrow-body-style": ["warn", "as-needed"],
48+
"prefer-arrow-callback": ["warn"],
49+
"no-inferrable-types": ["off", "ignore-params"],
50+
"no-unused-vars": ["off"],
51+
"no-useless-constructor": ["off"],
52+
"no-throw-literal": ["off"],
53+
54+
"header/header": ["error", "line", [" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"], 2],
55+
56+
"jsdoc/require-param-type": ["off"],
57+
"jsdoc/require-returns-type": ["off"],
58+
"jsdoc/newline-after-description": ["off"],
59+
60+
"import/no-unresolved": 1 // warn only on Unable to resolve path import/no-unresolved
61+
}
62+
}

source/.prettierrc.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# .prettierrc or .prettierrc.yaml
2+
arrowParens: "always"
3+
bracketSpacing: true
4+
endOfLine: "lf"
5+
htmlWhitespaceSensitivity: "css"
6+
proseWrap: "preserve"
7+
trailingComma: "es5"
8+
tabWidth: 2
9+
semi: true
10+
quoteProps: "as-needed"
11+
printWidth: 120

source/api-services/index.js

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
const scenarios = require('./lib/scenarios/');
5-
const metrics = require('./lib/metrics/');
4+
const scenarios = require("./lib/scenarios/");
5+
const metrics = require("./lib/metrics/");
66

77
exports.handler = async (event, context) => {
88
console.log(JSON.stringify(event, null, 2));
@@ -17,81 +17,94 @@ exports.handler = async (event, context) => {
1717
let response = {
1818
headers: {
1919
"Access-Control-Allow-Origin": "*",
20-
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
20+
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
2121
},
22-
statusCode: 200
22+
statusCode: 200,
2323
};
2424

2525
try {
2626
switch (resource) {
27-
case '/regions': {
28-
if (method === 'GET') {
29-
data = { regions: await scenarios.getAllRegionConfigs() };
30-
data.url = await scenarios.getCFUrl();
31-
} else {
32-
throw new Error(errMsg);
27+
case "/regions":
28+
{
29+
if (method === "GET") {
30+
data = { regions: await scenarios.getAllRegionConfigs() };
31+
data.url = await scenarios.getCFUrl();
32+
} else {
33+
throw new Error(errMsg);
34+
}
3335
}
34-
}
3536
break;
36-
case '/scenarios':
37+
case "/scenarios":
3738
switch (method) {
38-
case 'GET':
39-
if (event.queryStringParameters && event.queryStringParameters.op === 'listRegions') {
39+
case "GET":
40+
if (event.queryStringParameters && event.queryStringParameters.op === "listRegions") {
4041
data = { regions: await scenarios.getAllRegionConfigs() };
4142
data.url = await scenarios.getCFUrl();
4243
} else {
4344
data = await scenarios.listTests();
4445
}
4546
break;
46-
case 'POST':
47+
case "POST":
4748
if (config.scheduleStep) {
4849
const contextValues = {
4950
functionName: context.functionName,
50-
functionArn: context.invokedFunctionArn
51+
functionArn: context.invokedFunctionArn,
5152
};
52-
data = await scenarios.scheduleTest({
53-
resource: resource,
54-
httpMethod: method,
55-
body: event.body
56-
},
57-
contextValues);
58-
}
59-
else {
53+
data = await scenarios.scheduleTest(
54+
{
55+
resource: resource,
56+
httpMethod: method,
57+
body: event.body,
58+
},
59+
contextValues
60+
);
61+
} else {
6062
data = await scenarios.createTest(config);
6163
}
6264
//sending anonymous metrics (task Count) to aws
63-
if (process.env.SEND_METRIC === 'Yes') {
64-
await metrics.send({ testTaskConfigs: config.testTaskConfigs, testType: config.testType, fileType: config.fileType });
65+
if (process.env.SEND_METRIC === "Yes") {
66+
await metrics.send({
67+
testTaskConfigs: config.testTaskConfigs,
68+
testType: config.testType,
69+
fileType: config.fileType,
70+
});
6571
}
6672
break;
6773
default:
6874
throw new Error(errMsg);
6975
}
7076
break;
7177

72-
case '/scenarios/{testId}':
78+
case "/scenarios/{testId}":
7379
testId = event.pathParameters.testId;
7480
switch (method) {
75-
case 'GET':
81+
case "GET":
7682
data = await scenarios.getTest(testId);
7783
break;
78-
case 'POST':
84+
case "POST":
7985
data = await scenarios.cancelTest(testId);
8086
break;
81-
case 'DELETE':
87+
case "DELETE":
8288
data = await scenarios.deleteTest(testId, context.functionName);
8389
break;
8490
default:
8591
throw new Error(errMsg);
8692
}
8793
break;
88-
case '/tasks':
89-
if (method === 'GET') {
94+
case "/tasks":
95+
if (method === "GET") {
9096
data = await scenarios.listTasks();
9197
} else {
9298
throw new Error(errMsg);
9399
}
94100
break;
101+
case "/vCPUDetails":
102+
if (method === "GET") {
103+
data = await scenarios.getAccountFargatevCPUDetails();
104+
} else {
105+
throw new Error(errMsg);
106+
}
107+
break;
95108
default:
96109
throw new Error(errMsg);
97110
}

source/api-services/jest.config.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
module.exports = {
2-
roots: ['<rootDir>/lib'],
3-
testMatch: ['**/*.spec.js'],
4-
collectCoverageFrom: [
5-
'**/*.js'
6-
],
7-
coverageReporters: [
8-
"text",
9-
"clover",
10-
"json",
11-
["lcov", { "projectRoot": "../../" }]
12-
]
13-
};
5+
roots: ["<rootDir>/lib"],
6+
testMatch: ["**/*.spec.js"],
7+
collectCoverageFrom: ["**/*.js"],
8+
coverageReporters: ["text", "clover", "json", ["lcov", { projectRoot: "../../" }]],
9+
};

0 commit comments

Comments
 (0)