How do you do a load test for a Shopify app?

Viewed 289

I have a technical question regarding Shopify app load testing. My app adds an alternate product page to different stores and there is an api endpoint used by the end customers.

How do you do load testing to see how many customers can be served?

How do you simulate the loads generated by different stores?

I was trying to use apache benchmark but I can only test a store with it. Also, I don't have many test stores. Let's say there are several hundred stores using my app now. I just can't create so many stores

1 Answers

I am asking a similar question to this for myself. I used this in-dept guide to help me select the right tool, and I ended up going for Locust.io as my Shopify app is implemented in Python and I felt keeping all my tools in the same code base has some value (and also it seems like a really good tool for the purpose).

To answer your question about multiple stores, you will have to generate dummy test stores in your app's database (stores that don't exist in Shopify but does exist in your database). Then you script your load test to access those stores.

For example if your app has 3 endpoints; GET /alternate_product_page, POST /alternate_product_page and GET /some_resource, then you would set up a HttpUser class in Locust that exercises those endpoints as per normal usage, then start locust with that test load for each store id in your database.

The thing I have not figured out yet is how I can spoof authentication towards shopify during testing. I guess we will have to simply disable authentication altogether during testing.

Related