-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add k6 credential definition performance scenario
Signed-off-by: Anton Baliasnikov <anton.baliasnikov@iohk.io>
- Loading branch information
Anton Baliasnikov
committed
Nov 15, 2023
1 parent
4af753a
commit bd1a518
Showing
4 changed files
with
77 additions
and
44 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
41 changes: 41 additions & 0 deletions
41
...ance-tests/atala-performance-tests-k6/src/tests/credentials/credential-definition-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,41 @@ | ||
import { group } from "k6"; | ||
import { Options } from "k6/options"; | ||
import { Issuer } from "../../actors"; | ||
import { defaultOptions } from "../../scenarios/default"; | ||
import merge from "ts-deepmerge"; | ||
import { CredentialSchemaResponse } from "@input-output-hk/prism-typescript-client"; | ||
|
||
export const localOptions: Options = { | ||
// Important to have this threshold to have a special line for this group in the report | ||
thresholds: { | ||
'group_duration{group:::Issuer creates credential definition}': ['avg > 0'] | ||
} | ||
} | ||
export let options: Options = merge(localOptions, defaultOptions) | ||
|
||
export const issuer = new Issuer(); | ||
|
||
export function setup() { | ||
group("Issuer publishes DID", function () { | ||
issuer.createUnpublishedDid(); | ||
issuer.publishDid(); | ||
}); | ||
|
||
group("Issuer creates credential schema", function () { | ||
issuer.createCredentialSchema(); | ||
}); | ||
|
||
return { | ||
issuerDid: issuer.did, schema: issuer.schema | ||
}; | ||
} | ||
|
||
export default (data: { issuerDid: string, schema: CredentialSchemaResponse }) => { | ||
// This is the only way to pass data from setup to default | ||
issuer.did = data.issuerDid; | ||
issuer.schema = data.schema; | ||
|
||
group("Issuer creates credential definition", function () { | ||
issuer.createCredentialDefinition(); | ||
}); | ||
}; |