-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Nedbank implementation * Moved nedbank entity and change error message * Add data attributes and nedbank cronjob endpoint * Change order of cron job * Add comments and finish first stage * Add validation and refactor payment functions * lower duplicate numbers for test * Update PA multipliers * Add fixes * remove unused files * Update k6/helpers/registration-default.data.js Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com> * Update k6/models/programs.js Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com> * Update k6/tests/payment100kRegistrationNedbank.js Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com> * Update k6/tests/retryFailedJobsOnStartupDuringQueueProcessing.js Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com> * Fix missing error response log --------- Co-authored-by: Ruben <vandervalk@geoit.nl> Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
113 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { check, fail, sleep } from 'k6'; | ||
import { Counter } from 'k6/metrics'; | ||
|
||
import { registrationNedbank } from '../helpers/registration-default.data.js'; | ||
import InitializePaymentModel from '../models/initalize-payment.js'; | ||
|
||
const initializePayment = new InitializePaymentModel(); | ||
|
||
const duplicateNumber = 17; // '17' leads to 131k registrations | ||
const resetScript = 'nedbank-program'; | ||
const programId = 1; | ||
const paymentNr = 1; | ||
const maxTimeoutAttempts = 800; | ||
const status = 'waiting'; | ||
const minPassRatePercentage = 10; | ||
const amount = 20; | ||
|
||
export const options = { | ||
thresholds: { | ||
http_req_failed: ['rate<0.01'], // http errors should be less than 1% | ||
failed_checks: ['count<1'], // fail the test if any check fails | ||
}, | ||
vus: 1, | ||
duration: '80m', | ||
iterations: 1, | ||
}; | ||
|
||
const failedChecks = new Counter('failed_checks'); | ||
|
||
function checkAndFail(response, checks) { | ||
const result = check(response, checks); | ||
if (!result) { | ||
failedChecks.add(1); | ||
fail('One or more checks failed'); | ||
} | ||
} | ||
|
||
export default function () { | ||
const monitorPayment = initializePayment.initializePayment( | ||
resetScript, | ||
programId, | ||
registrationNedbank, | ||
duplicateNumber, | ||
maxTimeoutAttempts, | ||
status, | ||
minPassRatePercentage, | ||
paymentNr, | ||
amount, | ||
); | ||
checkAndFail(monitorPayment, { | ||
'Payment progressed successfully status 202': (r) => { | ||
if (r.status != 202) { | ||
const responseBody = JSON.parse(r.body); | ||
console.log(responseBody.error || r.status); | ||
} | ||
console.log('status: ', r.status); | ||
return r.status == 200; | ||
}, | ||
}); | ||
|
||
sleep(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
services/121-service/src/scripts/sql/mock-make-phone-unique.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters