diff --git a/packages/@n8n/benchmark/scripts/runOnVm/runOnVm.mjs b/packages/@n8n/benchmark/scripts/runOnVm/runOnVm.mjs index d8d3537dec..fd853203ac 100755 --- a/packages/@n8n/benchmark/scripts/runOnVm/runOnVm.mjs +++ b/packages/@n8n/benchmark/scripts/runOnVm/runOnVm.mjs @@ -26,14 +26,13 @@ async function main() { N8N_VERSION: n8nTag, BENCHMARK_VERSION: benchmarkTag, K6_API_TOKEN: k6ApiToken, - N8N_BENCHMARK_SCENARIO_NAME_PREFIX: n8nSetupToUse, }, }); try { await $$`docker-compose up -d n8n`; - await $$`docker-compose run benchmark run`; + await $$`docker-compose run benchmark run --scenarioNamePrefix=${n8nSetupToUse} `; } catch (error) { console.error('An error occurred while running the benchmarks:'); console.error(error); diff --git a/packages/@n8n/benchmark/src/commands/run.ts b/packages/@n8n/benchmark/src/commands/run.ts index 4476dbfbe0..5e2c1d3dc6 100644 --- a/packages/@n8n/benchmark/src/commands/run.ts +++ b/packages/@n8n/benchmark/src/commands/run.ts @@ -16,10 +16,14 @@ export default class RunCommand extends Command { description: 'Comma-separated list of test scenarios to run', required: false, }), + scenarioNamePrefix: Flags.string({ + description: 'Prefix for the scenario name. Defaults to Unnamed', + required: false, + }), }; async run() { - const config = loadConfig(); + const config = await this.loadConfigAndMergeWithFlags(); const scenarioLoader = new ScenarioLoader(); const scenarioRunner = new ScenarioRunner( @@ -41,4 +45,15 @@ export default class RunCommand extends Command { await scenarioRunner.runManyScenarios(allScenarios); } + + private async loadConfigAndMergeWithFlags() { + const config = loadConfig(); + const { flags } = await this.parse(RunCommand); + + if (flags.scenarioNamePrefix) { + config.set('scenarioNamePrefix', flags.scenarioNamePrefix); + } + + return config; + } }