Skip to content

tux7P/Lambda-Functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda-Functions

Instructions of the assesment can be found in this file: given_instructions.md

Solution

  1. ✅ Postman collection - QA_Challenge.postman_collection.json
  2. ✅ Integration tests [Loginactions & Sumactions] - Folder & Screenshot of passing tests
  3. ✅ Code coverage -Folder & Screenshot of passing tests
  4. ✅ Bugs found - Bug.md
Besides that, my solution has:
  • ⚡️ Unit tests [Loginactions & Sumactions] - Created to test both the lambda functions and to increase the code coverage with the help of Jest - Screenshot of passing tests
  • ⚡️ Github Actions - Created a workflow to run Integration tests and Unit tests on every push to the main branch
  • ⚡️ Superagent - Used to autoamte HTTP requests with a high-level abstraction
  • ⚡️ Jest - A testrunner used to automate unit tests with the flexibility to mock and stub the api calls
  • ⚡️ Code Abstraction - Code abstractions were made to simplify the test implememntation and for better maintainalibility and readability.
  • ⚡️ Commit style - Used conventional commit style.

Task Accomplishment Steps:

  1. Started with the local repo setup
  2. Ran offline serverless locally
  3. Explored lambda functions and its responses through POSTMAN
  4. Observed the bugs in code
  5. Created API tests using superagent
  6. Then created Integration tests with cucumber & superagent
  7. Wrote unit tests to improve the code coverage with Jest
  8. Created a Github workflow to run unit and integration tests in CI/CD env
  9. Documented the solution in README
  10. Submitted the code repository for review

Test Execution

  1. Clone this repository
  2. Navigate to the path the project was cloned in
  3. Install dependencies using:
yarn
  1. Run integration tests using:
yarn test:offline
  1. Run unit tests using:
yarn jest

Generate code coverage report using:

yarn coverage

To test postman collection:

  • Import the collection to Postman
  • Install serverless globally: npm -g install serverless@2.72.2
  • Start the server using: serverless offline
  • Then run the collection

Further Ideas:

  1. Improve the code coverage
  2. Implement stubs using Jest to test the lambda function
  3. Implement Artillery tests for load testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published