diff --git a/packages/@n8n/benchmark/.eslintrc.js b/packages/@n8n/benchmark/.eslintrc.js index 463a7d2f52..4d740c55b3 100644 --- a/packages/@n8n/benchmark/.eslintrc.js +++ b/packages/@n8n/benchmark/.eslintrc.js @@ -12,9 +12,10 @@ module.exports = { project: './tsconfig.json', }, - ignorePatterns: ['scenarios/**', 'scripts/**'], + ignorePatterns: ['scenarios/**'], rules: { + 'unicorn/filename-case': ['error', { case: 'kebabCase' }], 'n8n-local-rules/no-plain-errors': 'off', complexity: 'error', }, diff --git a/packages/@n8n/benchmark/package.json b/packages/@n8n/benchmark/package.json index 6a307c3ad4..67292b07c9 100644 --- a/packages/@n8n/benchmark/package.json +++ b/packages/@n8n/benchmark/package.json @@ -13,8 +13,8 @@ "benchmark": "zx scripts/run.mjs", "benchmark-in-cloud": "pnpm benchmark --env cloud", "benchmark-locally": "pnpm benchmark --env local", - "provision-cloud-env": "zx scripts/provisionCloudEnv.mjs", - "destroy-cloud-env": "zx scripts/destroyCloudEnv.mjs", + "provision-cloud-env": "zx scripts/provision-cloud-env.mjs", + "destroy-cloud-env": "zx scripts/destroy-cloud-env.mjs", "watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"" }, "engines": { diff --git a/packages/@n8n/benchmark/scenarios/binaryData/binaryData.json b/packages/@n8n/benchmark/scenarios/binary-data/binary-data.json similarity index 100% rename from packages/@n8n/benchmark/scenarios/binaryData/binaryData.json rename to packages/@n8n/benchmark/scenarios/binary-data/binary-data.json diff --git a/packages/@n8n/benchmark/scenarios/binaryData/binaryData.manifest.json b/packages/@n8n/benchmark/scenarios/binary-data/binary-data.manifest.json similarity index 63% rename from packages/@n8n/benchmark/scenarios/binaryData/binaryData.manifest.json rename to packages/@n8n/benchmark/scenarios/binary-data/binary-data.manifest.json index 13f2a8a127..e22eac8923 100644 --- a/packages/@n8n/benchmark/scenarios/binaryData/binaryData.manifest.json +++ b/packages/@n8n/benchmark/scenarios/binary-data/binary-data.manifest.json @@ -2,6 +2,6 @@ "$schema": "../scenario.schema.json", "name": "BinaryData", "description": "Send a binary file to a webhook, write it to FS, read it from FS and receive it back", - "scenarioData": { "workflowFiles": ["binaryData.json"] }, - "scriptPath": "binaryData.script.js" + "scenarioData": { "workflowFiles": ["binary-data.json"] }, + "scriptPath": "binary-data.script.js" } diff --git a/packages/@n8n/benchmark/scenarios/binaryData/binaryData.script.js b/packages/@n8n/benchmark/scenarios/binary-data/binary-data.script.js similarity index 100% rename from packages/@n8n/benchmark/scenarios/binaryData/binaryData.script.js rename to packages/@n8n/benchmark/scenarios/binary-data/binary-data.script.js diff --git a/packages/@n8n/benchmark/scenarios/httpNode/httpNode.json b/packages/@n8n/benchmark/scenarios/http-node/http-node.json similarity index 100% rename from packages/@n8n/benchmark/scenarios/httpNode/httpNode.json rename to packages/@n8n/benchmark/scenarios/http-node/http-node.json diff --git a/packages/@n8n/benchmark/scenarios/httpNode/httpNode.manifest.json b/packages/@n8n/benchmark/scenarios/http-node/http-node.manifest.json similarity index 68% rename from packages/@n8n/benchmark/scenarios/httpNode/httpNode.manifest.json rename to packages/@n8n/benchmark/scenarios/http-node/http-node.manifest.json index 01fdd95051..787569e63e 100644 --- a/packages/@n8n/benchmark/scenarios/httpNode/httpNode.manifest.json +++ b/packages/@n8n/benchmark/scenarios/http-node/http-node.manifest.json @@ -2,6 +2,6 @@ "$schema": "../scenario.schema.json", "name": "HttpNode", "description": "Webhook -> 3x HTTP request to a mock API -> Merge -> Respond to Webhook. Requires a mock API running at http://mockapi:8080", - "scenarioData": { "workflowFiles": ["httpNode.json"] }, - "scriptPath": "httpNode.script.js" + "scenarioData": { "workflowFiles": ["http-node.json"] }, + "scriptPath": "http-node.script.js" } diff --git a/packages/@n8n/benchmark/scenarios/httpNode/httpNode.script.js b/packages/@n8n/benchmark/scenarios/http-node/http-node.script.js similarity index 100% rename from packages/@n8n/benchmark/scenarios/httpNode/httpNode.script.js rename to packages/@n8n/benchmark/scenarios/http-node/http-node.script.js diff --git a/packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.json b/packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.json similarity index 100% rename from packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.json rename to packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.json diff --git a/packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.manifest.json b/packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.manifest.json similarity index 68% rename from packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.manifest.json rename to packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.manifest.json index 088e1b6c93..1d768f706e 100644 --- a/packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.manifest.json +++ b/packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.manifest.json @@ -2,6 +2,6 @@ "$schema": "../scenario.schema.json", "name": "CodeNodeJsOnceForEach", "description": "A JS Code Node that runs once for each item and adds, modifies and removes properties. The data of 5 items is generated using DebugHelper Node, and returned with RespondToWebhook Node.", - "scenarioData": { "workflowFiles": ["jsCodeNodeOnceForEach.json"] }, - "scriptPath": "jsCodeNodeOnceForEach.script.js" + "scenarioData": { "workflowFiles": ["js-code-node-once-for-each.json"] }, + "scriptPath": "js-code-node-once-for-each.script.js" } diff --git a/packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.script.js b/packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.script.js similarity index 100% rename from packages/@n8n/benchmark/scenarios/jsCodeNodeOnceForEach/jsCodeNodeOnceForEach.script.js rename to packages/@n8n/benchmark/scenarios/js-code-node-once-for-each/js-code-node-once-for-each.script.js diff --git a/packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.json b/packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.json similarity index 100% rename from packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.json rename to packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.json diff --git a/packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.manifest.json b/packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.manifest.json similarity index 50% rename from packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.manifest.json rename to packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.manifest.json index 850120aec1..0d37b09b96 100644 --- a/packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.manifest.json +++ b/packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.manifest.json @@ -2,6 +2,6 @@ "$schema": "../scenario.schema.json", "name": "SetNodeExpressions", "description": "Expressions in a Set node", - "scenarioData": { "workflowFiles": ["setNodeExpressions.json"] }, - "scriptPath": "setNodeExpressions.script.js" + "scenarioData": { "workflowFiles": ["set-node-expressions.json"] }, + "scriptPath": "set-node-expressions.script.js" } diff --git a/packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.script.js b/packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.script.js similarity index 100% rename from packages/@n8n/benchmark/scenarios/setNodeExpressions/setNodeExpressions.script.js rename to packages/@n8n/benchmark/scenarios/set-node-expressions/set-node-expressions.script.js diff --git a/packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.json b/packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.json similarity index 100% rename from packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.json rename to packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.json diff --git a/packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.manifest.json b/packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.manifest.json similarity index 58% rename from packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.manifest.json rename to packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.manifest.json index e9b4664a96..9c68908eef 100644 --- a/packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.manifest.json +++ b/packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.manifest.json @@ -2,6 +2,6 @@ "$schema": "../scenario.schema.json", "name": "SingleWebhook", "description": "A single webhook trigger that responds with a 200 status code", - "scenarioData": { "workflowFiles": ["singleWebhook.json"] }, - "scriptPath": "singleWebhook.script.ts" + "scenarioData": { "workflowFiles": ["single-webhook.json"] }, + "scriptPath": "single-webhook.script.ts" } diff --git a/packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.script.ts b/packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.script.ts similarity index 100% rename from packages/@n8n/benchmark/scenarios/singleWebhook/singleWebhook.script.ts rename to packages/@n8n/benchmark/scenarios/single-webhook/single-webhook.script.ts diff --git a/packages/@n8n/benchmark/scripts/clients/dockerComposeClient.mjs b/packages/@n8n/benchmark/scripts/clients/docker-compose-client.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/clients/dockerComposeClient.mjs rename to packages/@n8n/benchmark/scripts/clients/docker-compose-client.mjs diff --git a/packages/@n8n/benchmark/scripts/clients/sshClient.mjs b/packages/@n8n/benchmark/scripts/clients/ssh-client.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/clients/sshClient.mjs rename to packages/@n8n/benchmark/scripts/clients/ssh-client.mjs diff --git a/packages/@n8n/benchmark/scripts/clients/terraformClient.mjs b/packages/@n8n/benchmark/scripts/clients/terraform-client.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/clients/terraformClient.mjs rename to packages/@n8n/benchmark/scripts/clients/terraform-client.mjs diff --git a/packages/@n8n/benchmark/scripts/destroyCloudEnv.mjs b/packages/@n8n/benchmark/scripts/destroy-cloud-env.mjs similarity index 97% rename from packages/@n8n/benchmark/scripts/destroyCloudEnv.mjs rename to packages/@n8n/benchmark/scripts/destroy-cloud-env.mjs index 0e203efca3..0968c51e92 100644 --- a/packages/@n8n/benchmark/scripts/destroyCloudEnv.mjs +++ b/packages/@n8n/benchmark/scripts/destroy-cloud-env.mjs @@ -8,7 +8,7 @@ */ // @ts-check import { $, minimist } from 'zx'; -import { TerraformClient } from './clients/terraformClient.mjs'; +import { TerraformClient } from './clients/terraform-client.mjs'; const RESOURCE_GROUP_NAME = 'n8n-benchmarking'; diff --git a/packages/@n8n/benchmark/scripts/mockApi/mappings/mockApiData.json b/packages/@n8n/benchmark/scripts/mock-api/mappings/mockApiData.json similarity index 100% rename from packages/@n8n/benchmark/scripts/mockApi/mappings/mockApiData.json rename to packages/@n8n/benchmark/scripts/mock-api/mappings/mockApiData.json diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/postgres/docker-compose.yml b/packages/@n8n/benchmark/scripts/n8n-setups/postgres/docker-compose.yml similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/postgres/docker-compose.yml rename to packages/@n8n/benchmark/scripts/n8n-setups/postgres/docker-compose.yml diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/postgres/setup.mjs b/packages/@n8n/benchmark/scripts/n8n-setups/postgres/setup.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/postgres/setup.mjs rename to packages/@n8n/benchmark/scripts/n8n-setups/postgres/setup.mjs diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/docker-compose.yml b/packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/docker-compose.yml similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/docker-compose.yml rename to packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/docker-compose.yml diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/nginx.conf b/packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/nginx.conf similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/nginx.conf rename to packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/nginx.conf diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/setup.mjs b/packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/setup.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/scaling-multi-main/setup.mjs rename to packages/@n8n/benchmark/scripts/n8n-setups/scaling-multi-main/setup.mjs diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/scaling-single-main/docker-compose.yml b/packages/@n8n/benchmark/scripts/n8n-setups/scaling-single-main/docker-compose.yml similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/scaling-single-main/docker-compose.yml rename to packages/@n8n/benchmark/scripts/n8n-setups/scaling-single-main/docker-compose.yml diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/scaling-single-main/setup.mjs b/packages/@n8n/benchmark/scripts/n8n-setups/scaling-single-main/setup.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/scaling-single-main/setup.mjs rename to packages/@n8n/benchmark/scripts/n8n-setups/scaling-single-main/setup.mjs diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/sqlite-legacy/docker-compose.yml b/packages/@n8n/benchmark/scripts/n8n-setups/sqlite-legacy/docker-compose.yml similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/sqlite-legacy/docker-compose.yml rename to packages/@n8n/benchmark/scripts/n8n-setups/sqlite-legacy/docker-compose.yml diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/sqlite-legacy/setup.mjs b/packages/@n8n/benchmark/scripts/n8n-setups/sqlite-legacy/setup.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/sqlite-legacy/setup.mjs rename to packages/@n8n/benchmark/scripts/n8n-setups/sqlite-legacy/setup.mjs diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/sqlite/docker-compose.yml b/packages/@n8n/benchmark/scripts/n8n-setups/sqlite/docker-compose.yml similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/sqlite/docker-compose.yml rename to packages/@n8n/benchmark/scripts/n8n-setups/sqlite/docker-compose.yml diff --git a/packages/@n8n/benchmark/scripts/n8nSetups/sqlite/setup.mjs b/packages/@n8n/benchmark/scripts/n8n-setups/sqlite/setup.mjs similarity index 100% rename from packages/@n8n/benchmark/scripts/n8nSetups/sqlite/setup.mjs rename to packages/@n8n/benchmark/scripts/n8n-setups/sqlite/setup.mjs diff --git a/packages/@n8n/benchmark/scripts/provisionCloudEnv.mjs b/packages/@n8n/benchmark/scripts/provision-cloud-env.mjs similarity index 91% rename from packages/@n8n/benchmark/scripts/provisionCloudEnv.mjs rename to packages/@n8n/benchmark/scripts/provision-cloud-env.mjs index 5f10e7c60c..7a51c96db8 100644 --- a/packages/@n8n/benchmark/scripts/provisionCloudEnv.mjs +++ b/packages/@n8n/benchmark/scripts/provision-cloud-env.mjs @@ -6,7 +6,7 @@ */ // @ts-check import { which, minimist } from 'zx'; -import { TerraformClient } from './clients/terraformClient.mjs'; +import { TerraformClient } from './clients/terraform-client.mjs'; const args = minimist(process.argv.slice(3), { boolean: ['debug'], diff --git a/packages/@n8n/benchmark/scripts/runForN8nSetup.mjs b/packages/@n8n/benchmark/scripts/run-for-n8n-setup.mjs similarity index 96% rename from packages/@n8n/benchmark/scripts/runForN8nSetup.mjs rename to packages/@n8n/benchmark/scripts/run-for-n8n-setup.mjs index 0168b65efd..8ecdeca632 100755 --- a/packages/@n8n/benchmark/scripts/runForN8nSetup.mjs +++ b/packages/@n8n/benchmark/scripts/run-for-n8n-setup.mjs @@ -5,12 +5,12 @@ // @ts-check import path from 'path'; import { $, argv, fs } from 'zx'; -import { DockerComposeClient } from './clients/dockerComposeClient.mjs'; +import { DockerComposeClient } from './clients/docker-compose-client.mjs'; import { flagsObjectToCliArgs } from './utils/flags.mjs'; const paths = { - n8nSetupsDir: path.join(__dirname, 'n8nSetups'), - mockApiDataPath: path.join(__dirname, 'mockApi'), + n8nSetupsDir: path.join(__dirname, 'n8n-setups'), + mockApiDataPath: path.join(__dirname, 'mock-api'), }; const N8N_ENCRYPTION_KEY = 'very-secret-encryption-key'; diff --git a/packages/@n8n/benchmark/scripts/runInCloud.mjs b/packages/@n8n/benchmark/scripts/run-in-cloud.mjs similarity index 95% rename from packages/@n8n/benchmark/scripts/runInCloud.mjs rename to packages/@n8n/benchmark/scripts/run-in-cloud.mjs index c779ff7a45..35e90bdee5 100755 --- a/packages/@n8n/benchmark/scripts/runInCloud.mjs +++ b/packages/@n8n/benchmark/scripts/run-in-cloud.mjs @@ -11,8 +11,8 @@ // @ts-check import { sleep, which, $, tmpdir } from 'zx'; import path from 'path'; -import { SshClient } from './clients/sshClient.mjs'; -import { TerraformClient } from './clients/terraformClient.mjs'; +import { SshClient } from './clients/ssh-client.mjs'; +import { TerraformClient } from './clients/terraform-client.mjs'; import { flagsObjectToCliArgs } from './utils/flags.mjs'; /** @@ -96,7 +96,7 @@ async function runBenchmarksOnVm(config, benchmarkEnv) { */ async function runBenchmarkForN8nSetup({ config, sshClient, scriptsDir, n8nSetup }) { console.log(`Running benchmarks for ${n8nSetup}...`); - const runScriptPath = path.join(scriptsDir, 'runForN8nSetup.mjs'); + const runScriptPath = path.join(scriptsDir, 'run-for-n8n-setup.mjs'); const cliArgs = flagsObjectToCliArgs({ n8nDockerTag: config.n8nTag, diff --git a/packages/@n8n/benchmark/scripts/runLocally.mjs b/packages/@n8n/benchmark/scripts/run-locally.mjs similarity index 95% rename from packages/@n8n/benchmark/scripts/runLocally.mjs rename to packages/@n8n/benchmark/scripts/run-locally.mjs index c1a9affbe1..b2caec5218 100755 --- a/packages/@n8n/benchmark/scripts/runLocally.mjs +++ b/packages/@n8n/benchmark/scripts/run-locally.mjs @@ -39,7 +39,7 @@ const paths = { * @param {Config} config */ export async function runLocally(config) { - const runScriptPath = path.join(paths.scriptsDir, 'runForN8nSetup.mjs'); + const runScriptPath = path.join(paths.scriptsDir, 'run-for-n8n-setup.mjs'); const cliArgs = flagsObjectToCliArgs({ n8nDockerTag: config.n8nTag, diff --git a/packages/@n8n/benchmark/scripts/run.mjs b/packages/@n8n/benchmark/scripts/run.mjs index b0fadc5a25..e848c58fe1 100755 --- a/packages/@n8n/benchmark/scripts/run.mjs +++ b/packages/@n8n/benchmark/scripts/run.mjs @@ -9,11 +9,11 @@ import fs from 'fs'; import minimist from 'minimist'; import path from 'path'; -import { runInCloud } from './runInCloud.mjs'; -import { runLocally } from './runLocally.mjs'; +import { runInCloud } from './run-in-cloud.mjs'; +import { runLocally } from './run-locally.mjs'; const paths = { - n8nSetupsDir: path.join(path.resolve('scripts'), 'n8nSetups'), + n8nSetupsDir: path.join(path.resolve('scripts'), 'n8n-setups'), }; async function main() { diff --git a/packages/@n8n/benchmark/src/commands/list.ts b/packages/@n8n/benchmark/src/commands/list.ts index 485493e43d..7bcc4de2ce 100644 --- a/packages/@n8n/benchmark/src/commands/list.ts +++ b/packages/@n8n/benchmark/src/commands/list.ts @@ -1,6 +1,6 @@ import { Command } from '@oclif/core'; -import { ScenarioLoader } from '@/scenario/scenarioLoader'; -import { testScenariosPath } from '@/config/commonFlags'; +import { ScenarioLoader } from '@/scenario/scenario-loader'; +import { testScenariosPath } from '@/config/common-flags'; export default class ListCommand extends Command { static description = 'List all available scenarios'; diff --git a/packages/@n8n/benchmark/src/commands/run.ts b/packages/@n8n/benchmark/src/commands/run.ts index 18438748aa..eb895c842e 100644 --- a/packages/@n8n/benchmark/src/commands/run.ts +++ b/packages/@n8n/benchmark/src/commands/run.ts @@ -1,11 +1,11 @@ import { Command, Flags } from '@oclif/core'; -import { ScenarioLoader } from '@/scenario/scenarioLoader'; -import { ScenarioRunner } from '@/testExecution/scenarioRunner'; -import { N8nApiClient } from '@/n8nApiClient/n8nApiClient'; -import { ScenarioDataFileLoader } from '@/scenario/scenarioDataLoader'; -import type { K6Tag } from '@/testExecution/k6Executor'; -import { K6Executor } from '@/testExecution/k6Executor'; -import { testScenariosPath } from '@/config/commonFlags'; +import { ScenarioLoader } from '@/scenario/scenario-loader'; +import { ScenarioRunner } from '@/test-execution/scenario-runner'; +import { N8nApiClient } from '@/n8n-api-client/n8n-api-client'; +import { ScenarioDataFileLoader } from '@/scenario/scenario-data-loader'; +import type { K6Tag } from '@/test-execution/k6-executor'; +import { K6Executor } from '@/test-execution/k6-executor'; +import { testScenariosPath } from '@/config/common-flags'; export default class RunCommand extends Command { static description = 'Run all (default) or specified test scenarios'; @@ -80,10 +80,12 @@ export default class RunCommand extends Command { k6ApiToken: flags.k6ApiToken, n8nApiBaseUrl: flags.n8nBaseUrl, tags, - resultsWebhook: { - url: flags.resultWebhookUrl, - authHeader: flags.resultWebhookAuthHeader, - }, + resultsWebhook: flags.resultWebhookUrl + ? { + url: flags.resultWebhookUrl, + authHeader: flags.resultWebhookAuthHeader, + } + : undefined, }), { email: flags.n8nUserEmail, diff --git a/packages/@n8n/benchmark/src/config/commonFlags.ts b/packages/@n8n/benchmark/src/config/common-flags.ts similarity index 100% rename from packages/@n8n/benchmark/src/config/commonFlags.ts rename to packages/@n8n/benchmark/src/config/common-flags.ts diff --git a/packages/@n8n/benchmark/src/n8nApiClient/authenticatedN8nApiClient.ts b/packages/@n8n/benchmark/src/n8n-api-client/authenticated-n8n-api-client.ts similarity index 97% rename from packages/@n8n/benchmark/src/n8nApiClient/authenticatedN8nApiClient.ts rename to packages/@n8n/benchmark/src/n8n-api-client/authenticated-n8n-api-client.ts index f734cb2ac6..0272181799 100644 --- a/packages/@n8n/benchmark/src/n8nApiClient/authenticatedN8nApiClient.ts +++ b/packages/@n8n/benchmark/src/n8n-api-client/authenticated-n8n-api-client.ts @@ -1,5 +1,5 @@ import type { AxiosRequestConfig } from 'axios'; -import { N8nApiClient } from './n8nApiClient'; +import { N8nApiClient } from './n8n-api-client'; export class AuthenticatedN8nApiClient extends N8nApiClient { constructor( diff --git a/packages/@n8n/benchmark/src/n8nApiClient/n8nApiClient.ts b/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts similarity index 100% rename from packages/@n8n/benchmark/src/n8nApiClient/n8nApiClient.ts rename to packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts diff --git a/packages/@n8n/benchmark/src/n8nApiClient/n8nApiClient.types.ts b/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.types.ts similarity index 100% rename from packages/@n8n/benchmark/src/n8nApiClient/n8nApiClient.types.ts rename to packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.types.ts diff --git a/packages/@n8n/benchmark/src/n8nApiClient/workflowsApiClient.ts b/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts similarity index 84% rename from packages/@n8n/benchmark/src/n8nApiClient/workflowsApiClient.ts rename to packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts index 825303a111..76eea4284c 100644 --- a/packages/@n8n/benchmark/src/n8nApiClient/workflowsApiClient.ts +++ b/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts @@ -1,5 +1,5 @@ -import type { AuthenticatedN8nApiClient } from './authenticatedN8nApiClient'; -import type { Workflow } from '@/n8nApiClient/n8nApiClient.types'; +import type { AuthenticatedN8nApiClient } from './authenticated-n8n-api-client'; +import type { Workflow } from '@/n8n-api-client/n8n-api-client.types'; export class WorkflowApiClient { constructor(private readonly apiClient: AuthenticatedN8nApiClient) {} diff --git a/packages/@n8n/benchmark/src/scenario/scenarioDataLoader.ts b/packages/@n8n/benchmark/src/scenario/scenario-data-loader.ts similarity index 92% rename from packages/@n8n/benchmark/src/scenario/scenarioDataLoader.ts rename to packages/@n8n/benchmark/src/scenario/scenario-data-loader.ts index d59857cc62..b601d19902 100644 --- a/packages/@n8n/benchmark/src/scenario/scenarioDataLoader.ts +++ b/packages/@n8n/benchmark/src/scenario/scenario-data-loader.ts @@ -1,7 +1,7 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; import type { Scenario } from '@/types/scenario'; -import type { Workflow } from '@/n8nApiClient/n8nApiClient.types'; +import type { Workflow } from '@/n8n-api-client/n8n-api-client.types'; /** * Loads scenario data files from FS diff --git a/packages/@n8n/benchmark/src/scenario/scenarioLoader.ts b/packages/@n8n/benchmark/src/scenario/scenario-loader.ts similarity index 100% rename from packages/@n8n/benchmark/src/scenario/scenarioLoader.ts rename to packages/@n8n/benchmark/src/scenario/scenario-loader.ts diff --git a/packages/@n8n/benchmark/src/testExecution/k6Executor.ts b/packages/@n8n/benchmark/src/test-execution/k6-executor.ts similarity index 98% rename from packages/@n8n/benchmark/src/testExecution/k6Executor.ts rename to packages/@n8n/benchmark/src/test-execution/k6-executor.ts index 10664ad088..f99ffd80d9 100644 --- a/packages/@n8n/benchmark/src/testExecution/k6Executor.ts +++ b/packages/@n8n/benchmark/src/test-execution/k6-executor.ts @@ -3,7 +3,7 @@ import path from 'path'; import assert from 'node:assert/strict'; import { $, which, tmpfile } from 'zx'; import type { Scenario } from '@/types/scenario'; -import { buildTestReport, type K6Tag } from '@/testExecution/testReport'; +import { buildTestReport, type K6Tag } from '@/test-execution/test-report'; export type { K6Tag }; export type K6ExecutorOpts = { diff --git a/packages/@n8n/benchmark/src/testExecution/k6Summary.ts b/packages/@n8n/benchmark/src/test-execution/k6-summary.ts similarity index 100% rename from packages/@n8n/benchmark/src/testExecution/k6Summary.ts rename to packages/@n8n/benchmark/src/test-execution/k6-summary.ts diff --git a/packages/@n8n/benchmark/src/testExecution/scenarioDataImporter.ts b/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts similarity index 86% rename from packages/@n8n/benchmark/src/testExecution/scenarioDataImporter.ts rename to packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts index 25fc4cf875..cf6029834a 100644 --- a/packages/@n8n/benchmark/src/testExecution/scenarioDataImporter.ts +++ b/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts @@ -1,6 +1,6 @@ -import type { AuthenticatedN8nApiClient } from '@/n8nApiClient/authenticatedN8nApiClient'; -import type { Workflow } from '@/n8nApiClient/n8nApiClient.types'; -import { WorkflowApiClient } from '@/n8nApiClient/workflowsApiClient'; +import type { AuthenticatedN8nApiClient } from '@/n8n-api-client/authenticated-n8n-api-client'; +import type { Workflow } from '@/n8n-api-client/n8n-api-client.types'; +import { WorkflowApiClient } from '@/n8n-api-client/workflows-api-client'; /** * Imports scenario data into an n8n instance diff --git a/packages/@n8n/benchmark/src/testExecution/scenarioRunner.ts b/packages/@n8n/benchmark/src/test-execution/scenario-runner.ts similarity index 86% rename from packages/@n8n/benchmark/src/testExecution/scenarioRunner.ts rename to packages/@n8n/benchmark/src/test-execution/scenario-runner.ts index 4d70520910..135ebc6007 100644 --- a/packages/@n8n/benchmark/src/testExecution/scenarioRunner.ts +++ b/packages/@n8n/benchmark/src/test-execution/scenario-runner.ts @@ -1,9 +1,9 @@ -import type { K6Executor } from './k6Executor'; +import type { K6Executor } from './k6-executor'; import type { Scenario } from '@/types/scenario'; -import type { N8nApiClient } from '@/n8nApiClient/n8nApiClient'; -import type { ScenarioDataFileLoader } from '@/scenario/scenarioDataLoader'; -import { ScenarioDataImporter } from '@/testExecution/scenarioDataImporter'; -import { AuthenticatedN8nApiClient } from '@/n8nApiClient/authenticatedN8nApiClient'; +import type { N8nApiClient } from '@/n8n-api-client/n8n-api-client'; +import type { ScenarioDataFileLoader } from '@/scenario/scenario-data-loader'; +import { ScenarioDataImporter } from '@/test-execution/scenario-data-importer'; +import { AuthenticatedN8nApiClient } from '@/n8n-api-client/authenticated-n8n-api-client'; /** * Runs scenarios diff --git a/packages/@n8n/benchmark/src/testExecution/testReport.ts b/packages/@n8n/benchmark/src/test-execution/test-report.ts similarity index 100% rename from packages/@n8n/benchmark/src/testExecution/testReport.ts rename to packages/@n8n/benchmark/src/test-execution/test-report.ts