edamame-load-test / edamame

A distributed load testing framework for real-time collaboration apps (HTTP and WebSockets)
5 stars 1 forks source link

whitelist ip + dependency checks #105

Closed westrachel closed 1 year ago

westrachel commented 1 year ago

How to test the updates:

  1. Run edamame init to make a new cluster - if you don’t have helm installed this should intentionally fail b/c of missing dependencies

  2. Install helm - re-run edamame init and set up a cluster

  3. execute edamame run to run a test (db api should still be working post ingress url changes)

  4. Open up manifests/db_api_ingress.yaml and change the IP address listed in line 10 to a different IP address that doesn’t correspond with your IP address (change any of the numbers before the /32 to a different value; for example I had a value like 35.XX.17.XXX/32, that I changed to 35.XX.19.XXX/32)

  5. In the terminal execute kubectl apply -f db_api_ingress.yaml (assuming you’re in the manifests subfolder)

  6. Execute kubectl describe ingress/ingress-db-api in the terminal; the stdout should show you your updated incorrect IP address in the annotations section

  7. Execute edamame get - this command should not fail; it should restore the ip and then retry the axios request and should successfully return a table that has data for the singular test you ran (it will likely take longer than 1 minute so patience is key here)

  8. Execute kubectl describe ingress/ingress-db-api in the terminal; the stdout should show you your correct IP address in the annotations section (ie for me the ingress was restored to having my accurate 35.XX.17.XXX/32 ip address cidr block instead of my mutated/incorrect cidr block value of 35.XX.19.XXX/32)

I repeated the above testing steps (4 -> 8) for each of the edamame commands that involve different db api axios requests to ensure that the axios catch error handling was implemented correctly:

edamame get —name <test_name> edamame delete <test_name> edamame update -c <test_name> -n <new_test_name> edamame run

Here's an example of how long one of the commands took me due to all the underlying restoring IP address logic: [08:02:25:964] ℹ Deleting the test named: '8c227a3a-1f45-4f52-9699-921e6a1f6e54'... [08:03:44:562] ✔ Deleted the test named: '8c227a3a-1f45-4f52-9699-921e6a1f6e54'

gcpinckert commented 1 year ago

I ran into a couple of errors (after installing Helm and running npm install):

1)

--> edamame init                                                                                                               20:18:57  羽2.63s
file:///home/gcpinckert/edamame/src/utilities/cluster.js:25
  STATSITE_NODE_GRP_FILE
  ^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected identifier 'STATSITE_NODE_GRP_FILE'
    at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:456:14)

I believe this a syntax error is being caused by line 24 in cluster.js, which needs a comma at the end of it. Once adding the comma, I received the following error:

--> edamame init                                                                                                               20:19:03  羽110ms
file:///home/gcpinckert/edamame/src/utilities/eksctl.js:11
import files from '../utilities/files.js';
^^^^^^^^^^^^

SyntaxError: Identifier 'files' has already been declared
    at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:456:14)

In this case, line 11 of eksctl.js seems to be a repeat of line 1. I commented out line 11 and was able to run edamame init.

Other than that, all tests described above worked for me! Awesome job!!

I'm going to commit the two small changes I made to fix the syntax errors and merge the branch. Nice work!

westrachel commented 1 year ago

thank you for updating and testing! I did not accurately resolve all the merge conflicts based on those bugs