REFER TO THIS => https://github.com/rehanvdm/MicroService FOR AN EXPLANATION OF HOW TO USE THIS REPO
This is a stock standard CDK project using TypeScript.
- AWS IAM profile setup in
..\.aws\credentials
, with Admin rights. - AWS Chatbot + Slack integration into a channel (optional)
- AWS CDK bootstrap must have been run in the account already.
- Change directory to /part1
- Run
npm install
- Change directory to /part1/test and run
npm install
(optinal: only if you want to run tests) - Search and replace
rehan-demo
with your AWS profile name
cdk diff
compare deployed stack with current statecdk deploy
deploy this stack to your default AWS account/regionartillery-ping-pong
does light load testing usingartillery
Integration/end-to-end (e2e) and a basic load tests is written. Testing each api path and parameter combinations in certain tests.
Both negative and positive tests are written. All code/src tests are in /part1/test
.
- Change the URL and other constants if needed in
part1/test/_helpers/lambda_app.js
at the bottom of the file.
- Make sure that
helper.TestAgainst = Helper.TEST_AGAINST__DEPLOYED;
IS commented out. - Then test the /v1/ping/pong method. Other tests can also be done in a similar fashion.
node part1\test\node_modules\mocha\bin\_mocha --ui bdd part1\test\e2e\lambda\api\test-ping.js --grep "^Test Ping Pong Returns Pong$"
- Make sure that
helper.TestAgainst = Helper.TEST_AGAINST__DEPLOYED;
IS NOT commented out. - Then test the /v1/ping/pong method. Other tests can also be done in a similar fashion.
node part1\test\node_modules\mocha\bin\_mocha --ui bdd part1\test\e2e\lambda\api\test-ping.js --grep "^Test Ping Pong Returns Pong$"
- Make sure you have
artillery
installed
npm install -g artillery
- Change the URL in the file
part1/test/load/ping-pong.yml
- Run the command using npm
npm run artillery-ping-pong
API Swagger file can be found at part1\src\lambda\api\api-definition.yaml
or link =>