ci: Make end-to-end testing independent of development environments (no-changelog) (#4709)

* use user-folder override consistently everywhere, including for the `.cache` folder

* use consistent config for e2e tesing, skipping config loading from env and config files

* simplify all the cypress commands, and run all e2e tests on master
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-24 12:49:01 +01:00
committed by GitHub
parent b18ae18a6b
commit 500775de69
6 changed files with 57 additions and 38 deletions

View File

@@ -229,14 +229,7 @@ export function getUserSettingsPath(): string {
*
*/
export function getUserN8nFolderPath(): string {
let userFolder;
if (process.env[USER_FOLDER_ENV_OVERWRITE] !== undefined) {
userFolder = process.env[USER_FOLDER_ENV_OVERWRITE];
} else {
userFolder = getUserHome();
}
return path.join(userFolder, USER_SETTINGS_SUBFOLDER);
return path.join(getUserHome(), USER_SETTINGS_SUBFOLDER);
}
/**
@@ -264,16 +257,19 @@ export function getUserN8nFolderDownloadedNodesPath(): string {
*
*/
export function getUserHome(): string {
let variableName = 'HOME';
if (process.platform === 'win32') {
variableName = 'USERPROFILE';
}
if (process.env[USER_FOLDER_ENV_OVERWRITE] !== undefined) {
return process.env[USER_FOLDER_ENV_OVERWRITE];
} else {
let variableName = 'HOME';
if (process.platform === 'win32') {
variableName = 'USERPROFILE';
}
if (process.env[variableName] === undefined) {
// If for some reason the variable does not exist
// fall back to current folder
return process.cwd();
if (process.env[variableName] === undefined) {
// If for some reason the variable does not exist
// fall back to current folder
return process.cwd();
}
return process.env[variableName] as string;
}
return process.env[variableName] as string;
}