mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix: Fix scenario prefix not being passed (no-changelog) (#10575)
This commit is contained in:
parent
bc958be93b
commit
6017bf5af1
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue