-
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.
- Loading branch information
Anton Baliasnikov
committed
Jun 28, 2023
1 parent
e8411dd
commit 3600d38
Showing
12 changed files
with
260 additions
and
70 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
23 changes: 23 additions & 0 deletions
23
tests/performance-tests/atala-performance-tests-k6/src/tests/common.ts
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,23 @@ | ||
import { group } from "k6"; | ||
import { Holder, Issuer } from "../actors"; | ||
|
||
export const issuer = new Issuer(); | ||
export const holder = new Holder(); | ||
|
||
export function connectionFlow() { | ||
group('Issuer initiates connection with Holder', function () { | ||
issuer.createHolderConnection(); | ||
}); | ||
|
||
group('Holder accepts connection with Issuer', function () { | ||
holder.acceptIssuerConnection(issuer.connectionWithHolder!.invitation); | ||
}); | ||
|
||
group('Issuer finalizes connection with Holder', function () { | ||
issuer.finalizeConnectionWithHolder(); | ||
}); | ||
|
||
group('Holder finalizes connection with Issuer', function () { | ||
holder.finalizeConnectionWithIssuer(); | ||
}); | ||
} |
48 changes: 0 additions & 48 deletions
48
...erformance-tests/atala-performance-tests-k6/src/tests/connections/connection-flow-test.ts
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
...rformance-tests/atala-performance-tests-k6/src/tests/credentials/credential-offer-test.ts
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,74 @@ | ||
import { group } from 'k6'; | ||
import { Options } from 'k6/options'; | ||
import { Issuer, Holder } from '../../actors'; | ||
import { Connection } from '@input-output-hk/prism-typescript-client'; | ||
|
||
// export let options: Options = { | ||
// stages: [ | ||
// { duration: '1m', target: 5 }, | ||
// ], | ||
// thresholds: { | ||
// http_req_failed: [{ | ||
// threshold: 'rate<=0.05', | ||
// abortOnFail: true, | ||
// }], | ||
// http_req_duration: ['p(95)<=100'], | ||
// checks: ['rate>=0.99'], | ||
// }, | ||
// }; | ||
|
||
export let options: Options = { | ||
scenarios: { | ||
smoke: { | ||
executor: 'constant-vus', | ||
vus: 3, | ||
duration: "1s", | ||
}, | ||
}, | ||
thresholds: { | ||
'http_req_duration{group:::Issuer creates credential offer}': ['max >= 0'], | ||
'http_reqs{group:::Issuer creates credential offer}': ['count >= 0'], | ||
'group_duration{group:::Issuer creates credential offer}': ['max >= 0'], | ||
}, | ||
}; | ||
|
||
export const issuer = new Issuer(); | ||
export const holder = new Holder(); | ||
|
||
export function setup() { | ||
group('Issuer publishes DID', function () { | ||
issuer.createUnpublishedDid(); | ||
issuer.publishDid(); | ||
}); | ||
|
||
group('Holder creates unpublished DID', function () { | ||
holder.createUnpublishedDid(); | ||
}); | ||
|
||
group('Issuer connects with Holder', function () { | ||
issuer.createHolderConnection(); | ||
holder.acceptIssuerConnection(issuer.connectionWithHolder!.invitation); | ||
issuer.finalizeConnectionWithHolder(); | ||
holder.finalizeConnectionWithIssuer(); | ||
}); | ||
|
||
return { | ||
issuerDid: issuer.did, | ||
holderDid: holder.did, | ||
connectionWithHolder: issuer.connectionWithHolder!, | ||
connectionWithIssuer: holder.connectionWithIssuer! | ||
}; | ||
} | ||
|
||
export default (data: { issuerDid: string; holderDid: string; connectionWithHolder: Connection, connectionWithIssuer: Connection }) => { | ||
|
||
// This is the only way to pass data from setup to default | ||
issuer.did = data.issuerDid; | ||
holder.did = data.holderDid; | ||
issuer.connectionWithHolder = data.connectionWithHolder; | ||
holder.connectionWithIssuer = data.connectionWithIssuer; | ||
|
||
group('Issuer creates credential offer', function () { | ||
issuer.createCredentialOffer(); | ||
}); | ||
}; |
27 changes: 27 additions & 0 deletions
27
tests/performance-tests/atala-performance-tests-k6/src/tests/dids/create-prism-did-test.ts
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,27 @@ | ||
import { Options } from 'k6/options'; | ||
import { Issuer } from '../../actors'; | ||
|
||
// export let options: Options = { | ||
// stages: [ | ||
// { duration: '1m', target: 5 }, | ||
// ], | ||
// thresholds: { | ||
// http_req_failed: [{ | ||
// threshold: 'rate<=0.05', | ||
// abortOnFail: true, | ||
// }], | ||
// http_req_duration: ['p(95)<=100'], | ||
// checks: ['rate>=0.99'], | ||
// }, | ||
// }; | ||
|
||
export let options: Options = { | ||
vus: 1, | ||
iterations: 3000 | ||
}; | ||
|
||
const issuer = new Issuer(); | ||
|
||
export default () => { | ||
issuer.createUnpublishedDid(); | ||
}; |
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
24 changes: 24 additions & 0 deletions
24
tests/performance-tests/atala-performance-tests-k6/src/tests/flows/connection-flow-test.ts
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,24 @@ | ||
import { Options } from 'k6/options'; | ||
import { connectionFlow } from '../common'; | ||
|
||
export let options: Options = { | ||
scenarios: { | ||
smoke: { | ||
executor: 'constant-vus', | ||
vus: 3, | ||
duration: "1m", | ||
}, | ||
}, | ||
thresholds: { | ||
http_req_failed: [{ | ||
threshold: 'rate==0', | ||
abortOnFail: true, | ||
}], | ||
http_req_duration: ['p(95)<=500'], | ||
checks: ['rate==1'], | ||
}, | ||
}; | ||
|
||
export default() => { | ||
connectionFlow(); | ||
} |
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
Oops, something went wrong.