mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 17:23:21 +03:00
feat(server): userinfo signing (#10756)
* feat(server): userinfo signing * chore: e2e tests
This commit is contained in:
35
e2e/src/setup/docker-compose.ts
Normal file
35
e2e/src/setup/docker-compose.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { exec, spawn } from 'node:child_process';
|
||||
import { setTimeout } from 'node:timers';
|
||||
|
||||
const setup = async () => {
|
||||
let _resolve: () => unknown;
|
||||
let _reject: (error: Error) => unknown;
|
||||
|
||||
const ready = new Promise<void>((resolve, reject) => {
|
||||
_resolve = resolve;
|
||||
_reject = reject;
|
||||
});
|
||||
|
||||
const timeout = setTimeout(() => _reject(new Error('Timeout starting e2e environment')), 60_000);
|
||||
|
||||
const child = spawn('docker', ['compose', 'up'], { stdio: 'pipe' });
|
||||
|
||||
child.stdout.on('data', (data) => {
|
||||
const input = data.toString();
|
||||
console.log(input);
|
||||
if (input.includes('Immich Microservices is running')) {
|
||||
_resolve();
|
||||
}
|
||||
});
|
||||
|
||||
child.stderr.on('data', (data) => console.log(data.toString()));
|
||||
|
||||
await ready;
|
||||
clearTimeout(timeout);
|
||||
|
||||
return async () => {
|
||||
await new Promise<void>((resolve) => exec('docker compose down', () => resolve()));
|
||||
};
|
||||
};
|
||||
|
||||
export default setup;
|
||||
Reference in New Issue
Block a user