diff --git a/packages/@n8n/benchmark/src/commands/run.ts b/packages/@n8n/benchmark/src/commands/run.ts index 312de91c3c..ef9dfcdbd8 100644 --- a/packages/@n8n/benchmark/src/commands/run.ts +++ b/packages/@n8n/benchmark/src/commands/run.ts @@ -41,6 +41,11 @@ export default class RunCommand extends Command { default: undefined, env: 'K6_API_TOKEN', }), + out: Flags.string({ + description: 'The --out flag for k6', + default: undefined, + env: 'K6_OUT', + }), resultWebhookUrl: Flags.string({ doc: 'The URL where the benchmark results should be sent to', default: undefined, @@ -81,6 +86,7 @@ export default class RunCommand extends Command { new K6Executor({ duration: flags.duration, vus: flags.vus, + k6Out: flags.out, k6ExecutablePath: flags.k6ExecutablePath, k6ApiToken: flags.k6ApiToken, n8nApiBaseUrl: flags.n8nBaseUrl, diff --git a/packages/@n8n/benchmark/src/test-execution/k6-executor.ts b/packages/@n8n/benchmark/src/test-execution/k6-executor.ts index 42161c76ba..27ab679195 100644 --- a/packages/@n8n/benchmark/src/test-execution/k6-executor.ts +++ b/packages/@n8n/benchmark/src/test-execution/k6-executor.ts @@ -13,6 +13,7 @@ export type K6ExecutorOpts = { vus: number; /** Test duration, e.g. 1m or 30s */ duration: string; + k6Out?: string; k6ApiToken?: string; n8nApiBaseUrl: string; tags?: K6Tag[]; @@ -64,7 +65,9 @@ export function handleSummary(data) { ['--vus', this.opts.vus], ]; - if (!this.opts.resultsWebhook && this.opts.k6ApiToken) { + if (this.opts.k6Out) { + flags.push(['--out', this.opts.k6Out]); + } else if (!this.opts.resultsWebhook && this.opts.k6ApiToken) { flags.push(['--out', 'cloud']); }