-
Notifications
You must be signed in to change notification settings - Fork 15
Performance tests
You can create large data sets for load/performance testing in multiple ways:
- 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.
- 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
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:
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
You can execute or add new automated performance/load tests using k6 tool. Documentation and repository you can find here: https://github.com/global-121/121-platform/tree/main/k6
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
- Screens shouldn't take longer than 2 seconds to load
- No API calls are timing out