Create a tool to bulk create 1000s of Memberships for performance and batch tests
PR in #9
Some Memberships users reported some performance issue when running grant access batch jobs against large installs. We addressed some by implementing direct SQL queries and optimizing the code. However, we should have a better understanding of scaling issues by actually dealing with a large set of memberships, users, etc. rather than just a handful that we normally have on test sites.
Therefore, it would be ideal to have a tool to generate 1000s of memberships in bulk.
A tool could be included in the Dev Helper, to generate some content, products, then some plans with different properties that would assume those products and posts to restrict, then finally a variable set of many memberships and a similar amount of users (users could have more than one membership). Memberships should have various states: some expired, some delayed, some paused, etc. Subscriptions should exist too.
All of this should be generated by the tool and perhaps be a batch job itself, but also, at the end of the process, the tool should store the IDs of all the objects it created, so we can have another batch job to bulk delete everything that was created, to bring back the test site to a clean state as it was before.
Working at an implementation in #9 :

It comes with plenty of room for improvement, but I'd like to get to the point, it's just able to create simple memberships for basic membership plans connected to simple products perhaps.
To test for some of our batch processes in Memberships core we'd need orders as well though, so those should be generated along the way too.
As first pass, anyway, it's good if we can just get the minimum required objects: users, plans, user memberships. And have them created and deleted at will.