Performance tests - global-121/121-platform GitHub Wiki

Load testing the platform

You can create large data sets for load/performance testing in multiple ways:

By using a seed script which also creates mock data

  • You can now use the seed endpoint also to immediately create mock data
  • Currently, it works only for nlrc-multiple, and within that only loads data for OCW program. If needed for other programs, we can clone and adapt this one as needed.
  • You can specify with parameters how much registrations, transactions and messages you want
  • The underlying scripts blow up data in the database directly, which is really fast.

Via 121's import function

  • You can use 121's import function to import any large data set that you want.
  • This will take a bit of time, but will you more control over diverse data.
  • Also, this will not give you any transactions, messages, etc. yet

Generating test data

The following library can generate a CSV-file with large amounts of data: https://github.com/TheBlackHacker/csv-test-data-generator

Download generator.js(+related code) from the link above. One of the following commands can be used to generate a test data set:

NLRC

node generator.js \ 
    "id,note,phoneNumber,preferredLanguage,fspName,paymentAmountMultiplier,namePartnerOrganization,nameFirst,nameLast,vnumber,whatsappPhoneNumber" \
    "seq,alpha(0),digit(11),pick(en|nl),pick(Intersolve-whatsapp|Intersolve-no-whatsapp),pick(1|2),alpha(10),first,last,digit(10),digit(11)"  \
    5000 121-registered-pa_5000.csv

Performing the tests

You should use a production build to test the performance. When testing, throttle the internet connection to 'Fast 3G'. This way we can simulate a slow(er) connection.

IMPORTANT: Watch out with testing bulk messages, we don't want to spend our Twilio funds. And we want to test our own code and not someone else's code, so make sure to set the MOCK_TWILIO and MOCK_INTERSOLVE ENV-variables.

When performing the tests, the core features should at least be tested:

  • Registering a PA
  • Bulk actions (including etc.)
  • Using the PA table (filtering etc.)
  • Doing a payment
  • Exporting

Measurements

  • Screens shouldn't take longer than 2 seconds to load
  • No API calls are timing out