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

[Task] GH Action for Artillery test of /users lambda function and upload the storage container #272

Closed zxkevinxz closed 3 years ago

zxkevinxz commented 3 years ago

Is your feature request related to a problem? Please describe. As a user, when a branch is merged I want a GitHub Action to trigger that will run an Artillery test of the /users lambda function and upload to azure storage.

Describe the solution you'd like GH action to start an artillery test and upload result to storage

Additional context Will need to create an Artillery test, and add data to be able to test post for creating users.

zxkevinxz commented 3 years ago
  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