North-Seattle-College / ad440-winter2021-thursday-repo

NSC AD 440 Winter 2021 Thursday cohort practicum repo
Apache License 2.0
2 stars 27 forks source link

GH Action - Artillery test on AWS Lambda User function and upload to Azure Storage #275

Closed zxkevinxz closed 3 years ago

zxkevinxz commented 3 years ago

Closes #272 - A merge into development will trigger this action, and it will run an Artillery test on the AWS Lambda /users api and then upload the results to Azure storage.

  1. Created an Artillery test to target the AWS Lambda users api. This test will test both post and get. It will create users using the usersPayload that contains 1000 entries for user data.
  2. Created a usersPayload that contains firstName, lastName, and email in order to generate new users.
  3. Created a GitHub Action to run the test and upload the results.
  4. I noticed that some of the results/reports were getting unruly with names, and I tried to simplify mine. Since it is in a folder dedicated for Artillery results, I left that out of the name. I used this as the name format: lambda_users_YYYY-MM-DD-HH-MM-SS.json - I went with lambda_users because lambda represents that it is testing the AWS Lambda API, and not the Azure Functions, and then users to show it is testing the /users endpoint.

Testing

Testing with GitHub Actions is difficult, if you have the connection string secret in your repo, you can test it on your own repo. If not, here are is a link to a completed test from my repo: https://github.com/zxkevinxz/ad440-winter2021-thursday-repo/runs/2118082940?check_suite_focus=true

Here is a screenshot of the results that were uploaded to the Azure storage: Screen Shot 2021-03-15 at 7 39 11 PM

DATE ACTIVITY TIME
3/15 Creating Artillery Lambda test 0.5 hours
3/15 Starting GH Action shell 0.5 hours
3/15 Tested AZ storage 0.5 hours
3/15 Finished GH Action and added AZ CLI for upload 1.5 hours
3/15 PR and updating task 0.5 hours