mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(benchmark): Fix args formatting & validate scaling mode env vars (#10766)
Co-authored-by: Cornelius Suermann <cornelius@n8n.io>
This commit is contained in:
parent
bf43d67357
commit
b9d157db40
|
@ -36,6 +36,14 @@ async function main() {
|
||||||
const vus = argv.vus;
|
const vus = argv.vus;
|
||||||
const duration = argv.duration;
|
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)) {
|
if (!fs.existsSync(baseRunDir)) {
|
||||||
console.error(
|
console.error(
|
||||||
`The run directory "${baseRunDir}" does not exist. Please specify a valid directory using --runDir`,
|
`The run directory "${baseRunDir}" does not exist. Please specify a valid directory using --runDir`,
|
||||||
|
|
|
@ -10,5 +10,11 @@
|
||||||
export function flagsObjectToCliArgs(flags) {
|
export function flagsObjectToCliArgs(flags) {
|
||||||
return Object.entries(flags)
|
return Object.entries(flags)
|
||||||
.filter(([, value]) => value !== undefined)
|
.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}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue