Skip to content

Commit dfbab14

Browse files
committed
Cleanup
1 parent 3bef94c commit dfbab14

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

packages/cli/src/benchmark/lib/agent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import axios from 'axios';
2-
import { BACKEND_BASE_URL, INSTANCE_ONWER_EMAIL, INSTANCE_ONWER_PASSWORD } from './constants';
2+
import { BACKEND_BASE_URL, INSTANCE_ONWER } from './constants';
33
import { ApplicationError } from 'n8n-workflow';
44

55
export const agent = axios.create({ baseURL: BACKEND_BASE_URL });
66

77
export async function authenticateAgent() {
88
const response = await agent.post('/rest/login', {
9-
email: INSTANCE_ONWER_EMAIL,
10-
password: INSTANCE_ONWER_PASSWORD,
9+
email: INSTANCE_ONWER.EMAIL,
10+
password: INSTANCE_ONWER.PASSWORD,
1111
});
1212

1313
const cookies = response.headers['set-cookie'];
+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
export const BACKEND_BASE_URL = 'http://127.0.0.1:5678'; // localhost on GitHub Actions runners refuses connections
22

3-
export const INSTANCE_ONWER_EMAIL = '[email protected]';
4-
5-
export const INSTANCE_ONWER_PASSWORD = 'password';
3+
export const INSTANCE_ONWER = {
4+
5+
PASSWORD: 'password',
6+
FIRST_NAME: 'John',
7+
LAST_NAME: 'Smith',
8+
API_KEY:
9+
'n8n_api_96a4804143bdeb044802273c93423c33e1582c89a764c645fd6304fd2df19f3b2c73f4b972e28194',
10+
};

packages/cli/src/benchmark/lib/repositories/user.benchmark-repository.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import { Service } from 'typedi';
22
import { hash } from 'bcryptjs';
33
import { UserRepository as ProductionUserRepository } from '@/databases/repositories/user.repository';
4-
import { INSTANCE_ONWER_EMAIL, INSTANCE_ONWER_PASSWORD } from '../constants';
4+
import { INSTANCE_ONWER } from '../constants';
55

66
@Service()
77
export class UserRepository extends ProductionUserRepository {
88
async createInstanceOwner() {
99
const user = this.create({
10-
email: INSTANCE_ONWER_EMAIL,
11-
password: await hash(INSTANCE_ONWER_PASSWORD, 10),
12-
firstName: 'John',
13-
lastName: 'Smith',
10+
email: INSTANCE_ONWER.EMAIL,
11+
password: await hash(INSTANCE_ONWER.PASSWORD, 10),
12+
firstName: INSTANCE_ONWER.FIRST_NAME,
13+
lastName: INSTANCE_ONWER.LAST_NAME,
1414
role: 'global:owner',
15-
apiKey:
16-
'n8n_api_96a4804143bdeb044802273c93423c33e1582c89a764c645fd6304fd2df19f3b2c73f4b972e28194',
15+
apiKey: INSTANCE_ONWER.API_KEY,
1716
});
1817

1918
user.computeIsOwner();

packages/core/src/InstanceSettings.ts

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export class InstanceSettings {
7171
errorMessage: `Error parsing n8n-config file "${this.settingsFile}". It does not seem to be valid JSON.`,
7272
});
7373

74+
// @TODO: Remove first two logs in benchmark run
7475
if (!inTest) console.info(`User settings loaded from: ${this.settingsFile}`);
7576

7677
const { encryptionKey, tunnelSubdomain } = settings;

0 commit comments

Comments
 (0)