mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 06:31:58 +00:00
fix: web e2e (#12869)
This commit is contained in:
parent
b1cdf73a24
commit
0cce7ebf25
5 changed files with 9 additions and 11 deletions
|
@ -22,7 +22,6 @@ services:
|
||||||
- IMMICH_METRICS=true
|
- IMMICH_METRICS=true
|
||||||
- IMMICH_ENV=testing
|
- IMMICH_ENV=testing
|
||||||
volumes:
|
volumes:
|
||||||
- upload:/usr/src/app/upload
|
|
||||||
- ./test-assets:/test-assets
|
- ./test-assets:/test-assets
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- 'auth-server:host-gateway'
|
- 'auth-server:host-gateway'
|
||||||
|
@ -44,7 +43,3 @@ services:
|
||||||
POSTGRES_DB: immich
|
POSTGRES_DB: immich
|
||||||
ports:
|
ports:
|
||||||
- 5435:5432
|
- 5435:5432
|
||||||
|
|
||||||
volumes:
|
|
||||||
model-cache:
|
|
||||||
upload:
|
|
||||||
|
|
|
@ -53,8 +53,10 @@ export default defineConfig({
|
||||||
|
|
||||||
/* Run your local dev server before starting the tests */
|
/* Run your local dev server before starting the tests */
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'docker compose up --build -V --remove-orphans',
|
command: 'docker compose up --build --renew-anon-volumes --force-recreate --remove-orphans',
|
||||||
url: 'http://127.0.0.1:2285',
|
url: 'http://127.0.0.1:2285',
|
||||||
|
stdout: 'pipe',
|
||||||
|
stderr: 'pipe',
|
||||||
reuseExistingServer: true,
|
reuseExistingServer: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,8 @@ const setup = async () => {
|
||||||
|
|
||||||
const timeout = setTimeout(() => _reject(new Error('Timeout starting e2e environment')), 60_000);
|
const timeout = setTimeout(() => _reject(new Error('Timeout starting e2e environment')), 60_000);
|
||||||
|
|
||||||
const child = spawn('docker', ['compose', 'up'], { stdio: 'pipe' });
|
const command = 'compose up --build --renew-anon-volumes --force-recreate --remove-orphans';
|
||||||
|
const child = spawn('docker', command.split(' '), { stdio: 'pipe' });
|
||||||
|
|
||||||
child.stdout.on('data', (data) => {
|
child.stdout.on('data', (data) => {
|
||||||
const input = data.toString();
|
const input = data.toString();
|
||||||
|
|
|
@ -156,8 +156,7 @@ export const utils = {
|
||||||
|
|
||||||
for (const table of tables) {
|
for (const table of tables) {
|
||||||
if (table === 'system_metadata') {
|
if (table === 'system_metadata') {
|
||||||
// prevent reverse geocoder from being re-initialized
|
sql.push(`DELETE FROM "system_metadata" where "key" NOT IN ('reverse-geocoding-state', 'system-flags');`);
|
||||||
sql.push(`DELETE FROM "system_metadata" where "key" != 'reverse-geocoding-state';`);
|
|
||||||
} else {
|
} else {
|
||||||
sql.push(`DELETE FROM ${table} CASCADE;`);
|
sql.push(`DELETE FROM ${table} CASCADE;`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,13 @@ export class StorageService {
|
||||||
async onBootstrap() {
|
async onBootstrap() {
|
||||||
await this.databaseRepository.withLock(DatabaseLock.SystemFileMounts, async () => {
|
await this.databaseRepository.withLock(DatabaseLock.SystemFileMounts, async () => {
|
||||||
const flags = (await this.systemMetadata.get(SystemMetadataKey.SYSTEM_FLAGS)) || { mountFiles: false };
|
const flags = (await this.systemMetadata.get(SystemMetadataKey.SYSTEM_FLAGS)) || { mountFiles: false };
|
||||||
|
const enabled = flags.mountFiles ?? false;
|
||||||
|
|
||||||
this.logger.log('Verifying system mount folder checks');
|
this.logger.log(`Verifying system mount folder checks (enabled=${enabled})`);
|
||||||
|
|
||||||
// check each folder exists and is writable
|
// check each folder exists and is writable
|
||||||
for (const folder of Object.values(StorageFolder)) {
|
for (const folder of Object.values(StorageFolder)) {
|
||||||
if (!flags.mountFiles) {
|
if (!enabled) {
|
||||||
this.logger.log(`Writing initial mount file for the ${folder} folder`);
|
this.logger.log(`Writing initial mount file for the ${folder} folder`);
|
||||||
await this.createMountFile(folder);
|
await this.createMountFile(folder);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue