chore(server): cleanup library watching ()

chore: clean up library watching
This commit is contained in:
Jason Rasmussen 2024-04-15 23:05:08 -04:00 committed by GitHub
parent 1c1e461936
commit dba365634a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 56 additions and 1088 deletions
e2e/src

View file

@ -21,10 +21,12 @@ import {
getAllAssets,
getAllJobsStatus,
getAssetInfo,
getConfigDefaults,
login,
searchMetadata,
setAdminOnboarding,
signUpAdmin,
updateConfig,
validate,
} from '@immich/sdk';
import { BrowserContext } from '@playwright/test';
@ -139,6 +141,7 @@ export const utils = {
'user_token',
'users',
'system_metadata',
'system_config',
];
const sql: string[] = [];
@ -148,7 +151,12 @@ export const utils = {
}
for (const table of tables) {
sql.push(`DELETE FROM ${table} CASCADE;`);
if (table === 'system_metadata') {
// prevent reverse geocoder from being re-initialized
sql.push(`DELETE FROM "system_metadata" where "key" != 'reverse-geocoding-state';`);
} else {
sql.push(`DELETE FROM ${table} CASCADE;`);
}
}
await client.query(sql.join('\n'));
@ -310,9 +318,7 @@ export const utils = {
if (!existsSync(dirname(path))) {
mkdirSync(dirname(path), { recursive: true });
}
if (!existsSync(path)) {
writeFileSync(path, makeRandomImage());
}
writeFileSync(path, makeRandomImage());
},
removeImageFile: (path: string) => {
@ -407,8 +413,14 @@ export const utils = {
},
]),
deleteTempFolder: () => {
resetTempFolder: () => {
rmSync(`${testAssetDir}/temp`, { recursive: true, force: true });
mkdirSync(`${testAssetDir}/temp`, { recursive: true });
},
resetAdminConfig: async (accessToken: string) => {
const defaultConfig = await getConfigDefaults({ headers: asBearerAuth(accessToken) });
await updateConfig({ systemConfigDto: defaultConfig }, { headers: asBearerAuth(accessToken) });
},
isQueueEmpty: async (accessToken: string, queue: keyof AllJobStatusResponseDto) => {