-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure all defined performance tests compile and run #732
Closed
+109
−229
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
93e1431
fix: ensure all defined performance tests compile and run
davepoltorak 16a2daa
ci: run all defined performance smoke tests as part of every PR
davepoltorak 09034fe
fix: create schema before trying to issue credential offer in perf test
davepoltorak 541fb49
fix: comply to eslint rules
davepoltorak d194fb4
fix: eslint config for __ENV
davepoltorak c4f859f
fix: change smoke workload and thresholds
davepoltorak df232b8
fix: switching back to shared interations to 1 cycle completes
davepoltorak 406855d
fix: set thresholds to very high due to ci failures
davepoltorak bb05c3e
fix: set setupTimeout to increased value
davepoltorak 15a1c7d
Merge branch 'main' into feature/running-local-performance-tests-squa…
yshyn-iohk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ import { sleep } from "k6"; | |
import { HttpService } from "./HttpService"; | ||
import { ISSUER_AGENT_URL, WAITING_LOOP_MAX_ITERATIONS, WAITING_LOOP_PAUSE_INTERVAL } from "./Config"; | ||
import { IssueCredentialRecord, Connection, CredentialSchemaResponse } from "@input-output-hk/prism-typescript-client"; | ||
import {v4 as uuidv4} from 'uuid'; | ||
import { crypto } from "k6/experimental/webcrypto"; | ||
|
||
|
||
/** | ||
* A service class for managing credentials in the application. | ||
|
@@ -18,8 +19,8 @@ export class CredentialsService extends HttpService { | |
*/ | ||
createCredentialOffer(issuingDid: string, connection: Connection, schema: CredentialSchemaResponse): IssueCredentialRecord { | ||
const payload = `{ | ||
"claims": { | ||
"emailAddress": "${uuidv4()}[email protected]", | ||
"claims": { | ||
"emailAddress": "${crypto.randomUUID()}[email protected]", | ||
"familyName": "Test", | ||
"dateOfIssuance": "${new Date()}", | ||
"drivingLicenseID": "Test", | ||
|
@@ -31,13 +32,13 @@ export class CredentialsService extends HttpService { | |
"automaticIssuance": false | ||
}`; | ||
const res = this.post("issue-credentials/credential-offers", payload); | ||
return res.json() as unknown as IssueCredentialRecord; | ||
return this.toJson(res) as unknown as IssueCredentialRecord; | ||
} | ||
|
||
createCredentialSchema(issuingDid: string): CredentialSchemaResponse { | ||
const payload = ` | ||
{ | ||
"name": "${uuidv4()}}", | ||
"name": "${crypto.randomUUID()}}", | ||
"version": "1.0.0", | ||
"description": "Simple credential schema for the driving licence verifiable credential.", | ||
"type": "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json", | ||
|
@@ -85,7 +86,7 @@ export class CredentialsService extends HttpService { | |
} | ||
` | ||
const res = this.post("schema-registry/schemas", payload); | ||
return res.json() as unknown as CredentialSchemaResponse; | ||
return this.toJson(res) as unknown as CredentialSchemaResponse; | ||
} | ||
|
||
/** | ||
|
@@ -95,7 +96,7 @@ export class CredentialsService extends HttpService { | |
*/ | ||
getCredentialRecord(record: IssueCredentialRecord): IssueCredentialRecord { | ||
const res = this.get(`issue-credentials/records/${record.recordId}`); | ||
return res.json() as unknown as IssueCredentialRecord; | ||
return this.toJson(res) as unknown as IssueCredentialRecord; | ||
} | ||
|
||
/** | ||
|
@@ -104,7 +105,7 @@ export class CredentialsService extends HttpService { | |
*/ | ||
getCredentialRecords(thid: string): IssueCredentialRecord[] { | ||
const res = this.get(`issue-credentials/records?thid=${thid}`); | ||
return res.json("contents") as unknown as IssueCredentialRecord[]; | ||
return this.toJson(res).contents as unknown as IssueCredentialRecord[]; | ||
} | ||
|
||
/** | ||
|
@@ -116,7 +117,7 @@ export class CredentialsService extends HttpService { | |
acceptCredentialOffer(record: IssueCredentialRecord, subjectDid: string): IssueCredentialRecord { | ||
const payload = { subjectId: subjectDid }; | ||
const res = this.post(`issue-credentials/records/${record.recordId}/accept-offer`, payload, 200); | ||
return res.json() as unknown as IssueCredentialRecord; | ||
return this.toJson(res) as unknown as IssueCredentialRecord; | ||
} | ||
|
||
/** | ||
|
@@ -126,7 +127,7 @@ export class CredentialsService extends HttpService { | |
*/ | ||
issueCredential(record: IssueCredentialRecord): IssueCredentialRecord { | ||
const res = this.post(`issue-credentials/records/${record.recordId}/issue-credential`, null, 200); | ||
return res.json() as unknown as IssueCredentialRecord; | ||
return this.toJson(res) as unknown as IssueCredentialRecord; | ||
} | ||
|
||
/** | ||
|
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
31 changes: 31 additions & 0 deletions
31
tests/performance-tests/atala-performance-tests-k6/src/scenarios/default.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,31 @@ | ||
/*global __ENV*/ | ||
|
||
import { Options } from "k6/options"; | ||
|
||
export const defaultOptions: Options = { | ||
setupTimeout: '120s', | ||
scenarios: { | ||
smoke: { | ||
// a simple test to ensure performance tests work and requests don't fail | ||
executor: "shared-iterations", | ||
vus: 1, | ||
iterations: 1, | ||
tags: { scenario_label: __ENV.SCENARIO_LABEL || "defaultScenarioLabel" }, // add label for filtering in observability platform | ||
}, | ||
}, | ||
thresholds: { | ||
http_req_failed: [ | ||
// fail if any requests fail during smoke test | ||
{ | ||
threshold: "rate==0", | ||
abortOnFail: true, | ||
}, | ||
], | ||
http_req_duration: [ | ||
{ threshold: "p(95)<2000", abortOnFail: true }, // 95% of requests should complete within 2 seconds | ||
{ threshold: "p(99)<5000", abortOnFail: true }, // 99% of requests should complete within 5 seconds | ||
], | ||
checks: [{ threshold: "rate==1", abortOnFail: true }], // fail if any checks fail (the checks are defined in test code which is executed) | ||
|
||
} | ||
} |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidpoltorak-io, you need to make the length of the key at least 16 bytes. I will not work with the current Agent with
default
value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @yshyn-iohk - I've been struggling to get this branch ready for merging - between performance thresholds being passed and some failed runs - this really helps - I'll make the change and retest