-
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:
NEW:
- The below-mentioned manual script is now included in a seed script which makes it even easier to run
- It works only for nlrc-multiple, and within that only loads data for OCW program with Visa FSP
- You can specify with parameters how much registrations, transactions and messages you want
- IMPORTANT: this seed script does not yet include blowing up Visa customers & wallets. For this you can still use the manual script mentioned below.
OLD:
- You can create a small dataset (1 PA) manually and blow this up in the database quickly
- Use the script and instructions in /~https://github.com/global-121/121-platform/blob/master/features/test-registration-data/blow-up-registrations-in-db.sql
- This is by far the quickest way to get a large dataset, especially if you e.g. also want many transactions.
- The limitation is that there is little diversity in the data, as it's all a copy from itself.
- 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 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