From 6422fb33c039ea381d88c04d8ef45e882bdc77bf Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen <10324676+tomi@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:14:19 +0300 Subject: [PATCH] fix: Pass k6 api token correctly (no-changelog) (#10536) --- .../@n8n/benchmark/scripts/runInCloud.mjs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/@n8n/benchmark/scripts/runInCloud.mjs b/packages/@n8n/benchmark/scripts/runInCloud.mjs index c567ec04759f9..9d6f2b9556da3 100755 --- a/packages/@n8n/benchmark/scripts/runInCloud.mjs +++ b/packages/@n8n/benchmark/scripts/runInCloud.mjs @@ -88,13 +88,22 @@ async function runBenchmarksOnVm(config, benchmarkEnv) { console.log('Running benchmarks...'); const runScriptPath = path.join(scriptsDir, 'runOnVm.mjs'); - await sshClient.ssh( - `npx zx ${runScriptPath} --n8nDockerTag=${config.n8nTag} --benchmarkDockerTag=${config.benchmarkTag} ${config.n8nSetupToUse}`, - { - // Test run should always log its output - verbose: true, - }, - ); + + const flags = { + n8nDockerTag: config.n8nTag, + benchmarkDockerTag: config.benchmarkTag, + k6ApiToken: config.k6ApiToken, + }; + + const flagsString = Object.entries(flags) + .filter(([, value]) => value !== undefined) + .map(([key, value]) => `--${key}=${value}`) + .join(' '); + + await sshClient.ssh(`npx zx ${runScriptPath} ${flagsString} ${config.n8nSetupToUse}`, { + // Test run should always log its output + verbose: true, + }); } async function ensureVmIsReachable(sshClient) {