Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Apr 19, 2024
1 parent 8a0f64b commit fe4ce3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions packages/cli/src/benchmark/lib/global-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ function n8nDir() {

writeFileSync(
path.join(_n8nDir, 'config'),
JSON.stringify({ encryptionKey: 'temp_encryption_key', instanceId: '123' }),
JSON.stringify({ encryptionKey: 'temp_encryption_key', instanceId: 'temp-123' }),
'utf-8',
);

/**
* @TODO Better approach? Setting N8N_USER_FOLDER has no effect
* @TODO Better approach than overriding? Setting N8N_USER_FOLDER has no effect
*/
const instanceSettings = Container.get(InstanceSettings);
instanceSettings.n8nFolder = _n8nDir;
Expand All @@ -46,7 +46,7 @@ async function mainProcess() {
await main.run();
}

async function setup() {
export async function setup() {
n8nDir();

await mainProcess();
Expand All @@ -56,9 +56,6 @@ async function setup() {
await createOwner();
}

async function teardown() {
export async function teardown() {
await main.stopProcess();
}

/** Lifecycle hooks to run once before and after all benchmarking tasks. */
export const globalHooks = { setup, teardown };
2 changes: 1 addition & 1 deletion packages/cli/src/benchmark/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'reflect-metadata';
import { globalHooks } from './lib/global-hooks';
import * as globalHooks from './lib/global-hooks';
import { collectSuites, registerSuites, suiteCount } from './lib/suites';

/* eslint-disable import/no-extraneous-dependencies */
Expand Down

0 comments on commit fe4ce3c

Please sign in to comment.