Skip to content

Commit

Permalink
fix(benchmark): Fix args formatting & validate scaling mode env vars (#…
Browse files Browse the repository at this point in the history
…10766)

Co-authored-by: Cornelius Suermann <[email protected]>
  • Loading branch information
tomi and csuermann authored Sep 11, 2024
1 parent bf43d67 commit b9d157d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/@n8n/benchmark/scripts/runForN8nSetup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ async function main() {
const vus = argv.vus;
const duration = argv.duration;

const hasN8nLicense = !!n8nLicenseCert || !!n8nLicenseActivationKey;
if (n8nSetupToUse === 'scaling' && !hasN8nLicense) {
console.error(
'n8n license is required to run the scaling setup. Please provide N8N_LICENSE_CERT or N8N_LICENSE_ACTIVATION_KEY',
);
process.exit(1);
}

if (!fs.existsSync(baseRunDir)) {
console.error(
`The run directory "${baseRunDir}" does not exist. Please specify a valid directory using --runDir`,
Expand Down
8 changes: 7 additions & 1 deletion packages/@n8n/benchmark/scripts/utils/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
export function flagsObjectToCliArgs(flags) {
return Object.entries(flags)
.filter(([, value]) => value !== undefined)
.map(([key, value]) => `--${key}=${value}`);
.map(([key, value]) => {
if (typeof value === 'string' && value.includes(' ')) {
return `--${key}="${value}"`;
} else {
return `--${key}=${value}`;
}
});
}

0 comments on commit b9d157d

Please sign in to comment.