Skip to content
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

🎨 resolve remaining repo code scanning warnings #1113

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/k6/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function setup() {
}
}

return { bearerToken, issuers };
return bearerToken, issuers;
}

// Helper function to calculate the wallet index based on VU and iteration
Expand Down
2 changes: 1 addition & 1 deletion scripts/k6/scenarios/create-invitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function setup() {
console.error("Failed to bootstrap issuers.");
}

return { bearerToken, issuers, holders };
return bearerToken, issuers, holders;
}

function getIssuerIndex(vu, iter) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/k6/scenarios/create-issuers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const options = {
scenarios: {
default: {
executor: "per-vu-iterations",
vus: vus,
iterations: iterations,
vus,
iterations,
maxDuration: "24h",
},
},
Expand Down Expand Up @@ -66,7 +66,7 @@ const wallets = new SharedArray("wallets", () => {
export function setup() {
const bearerToken = getBearerToken();
file.writeString(outputFilepath, "");
return { bearerToken };
return bearerToken;
}

const iterationsPerVU = options.scenarios.default.iterations;
Expand Down
31 changes: 17 additions & 14 deletions scripts/k6/scenarios/create-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const schemas = new SharedArray("schemas", () => {
export function setup() {
file.writeString(outputFilepath, "");
const governanceBearerToken = getGovernanceBearerToken();
return { governanceBearerToken }; // eslint-disable-line no-eval
return governanceBearerToken; // eslint-disable-line no-eval
}

const iterationsPerVU = options.scenarios.default.iterations;
Expand Down Expand Up @@ -95,20 +95,23 @@ export default function (data) {
schema.schemaName,
schema.schemaVersion
);
check(getSchemaResponse, {
"getSchema check passes": (r) => {
if (r.status !== 200 || r.body === "[]") {
return false;
}

try {
const schemaData = JSON.parse(r.body);
return schemaData.length > 0 && schemaData[0].id != null;
} catch (e) {
console.error("Failed to parse schema data:", e);
return false;
}
},
function isSchemaValid(response) {
if (response.status !== 200 || response.body === "[]") {
return false;
}

try {
const schemaData = JSON.parse(response.body);
return schemaData.length > 0 && schemaData[0].id != null;
} catch (e) {
console.error("Failed to parse schema data:", e);
return false;
}
}

check(getSchemaResponse, {
"getSchema check passes": (r) => isSchemaValid(r),
});

const { id: schemaId } = JSON.parse(getSchemaResponse.body)[0];
Expand Down
2 changes: 1 addition & 1 deletion scripts/k6/scenarios/delete-holders.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const filepath = "output/create-holders.json";

export function setup() {
const bearerToken = getBearerToken();
return { bearerToken };
return bearerToken;
}

const iterationsPerVU = options.scenarios.default.iterations;
Expand Down
Loading