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] Change GitHub action for serverless-artillery #152

Open Dylan-Riley opened 3 years ago

Dylan-Riley commented 3 years ago

Task:

Change GitHub action for serverless-artillery to test the new function /users/{user_id}/tasks and save the results in the correct AWS Bucket with the correct naming conventions.


More details:

All lowercase names! S3 bucket names:

artillery serverless-artillery

Test results naming convention:

[bucketname]/YYYY/mm/DD/HH-MM-SS.xxx.json

Examples: artillery/2021/02/04/20-26-36.100.json serverless-artillery/2021/02/04/20-26-36.100.json

Tags for each resource:

NSCYear : 2021 NSCCohort : Thursday Owner : [name of resource creator] OwnerEmail : [creator's seattlecolleges.edu email]

Update:

artillery-and-actions-filename-conventions.docx

./test/serverless-artillery/serverless-artillery-test-users-id-tasks-api.yml ./.github/workflows/serverless-artillery-action-users-id-tasks-api.yml

Dylan-Riley commented 3 years ago

File location: ./.github/workflows/Serverless-artilleryreport-users-user_id-tasks.yml

EDIT: Also: ./test/artillery/Artillery-test-users-user_id-tasks.yml

EDIT 2: Do not touch file mentioned in first edit, that's artillery, not serverless-artillery. Need to create a new /test/serverless-artillery/ file. Or that file is the correct file, but horribly outdated at this point. See https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/issues/152#issuecomment-777930900 for function to target.

Dylan-Riley commented 3 years ago

See issue https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/issues/92 and pull request https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/pull/124 for @jaguiniga's previous work on serverless-artillery reporting for /users/{user_id}/tasks

See issue https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/issues/5 and pull request https://github.com/North-Seattle-College/ad440-winter2021-thursday-repo/pull/39 for initial GitHub action to start serverless-artillery test setup.

Dylan-Riley commented 3 years ago

Function to test will be found in Azure Resource Group nsc-rg-dev-usw2-thursday in the Function App nsc-fun-dev-usw2-thursday

At time of writing (11/FEB/2021 6:40 PM) does not exist yet https://nsc-fun-dev-usw2-thursday.azurewebsites.net/api/users/1/tasks? Might be better to not code a specific user but I don't have time to look into that right now


Buckets artillery and serverless-artillery also do not seem to exist in AWS S3 yet 11/FEB/2021 8:15 PM: Created buckets artillery and serverless-artillery

Dylan-Riley commented 3 years ago

See: https://github.com/marketplace/actions/upload-s3 for an example of using GitHub actions to upload things to AWS S3

This seems to be using some outdated stuff. Instead I'm trying out https://github.com/marketplace/actions/s3-cp-file that seems to just use the AWS CLI CP function

Just use AWS CLI S3. It's referenced here and looks much better. Though currently seems to be another permission issue...

Dylan-Riley commented 3 years ago

Serverless-artillery does not work with the latest version of serverless. Hasn't for a while now...

The error message says to use "^1.0.3" but installing that specific version breaks something else. In a previous build of this test the version 1.38.0 was used and that seems to let slsart commands actually run.

Dylan-Riley commented 3 years ago

image

This is weirdly comforting to see. It looks like I may have hit them a bunch of times, but just made a bad call? Maybe it's because the function is 500'ing?