mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 12:19:05 +00:00
test(server): full backend end-to-end testing with microservices (#4225)
* feat: asset e2e with job option * feat: checkout test assets * feat: library e2e tests * fix: use node 21 in e2e * fix: tests * fix: use normalized external path * feat: more external path tests * chore: use parametrized tests * chore: remove unused test code * chore: refactor test asset path * feat: centralize test app creation * fix: correct error message for missing assets * feat: test file formats * fix: don't compare checksum * feat: build libvips * fix: install meson * fix: use immich test asset repo * feat: test nikon raw files * fix: set Z timezone * feat: test offline library files * feat: richer metadata tests * feat: e2e tests in docker * feat: e2e test with arm64 docker * fix: manual docker compose run * fix: remove metadata processor import * fix: run e2e tests in test.yml * fix: checkout e2e assets * fix: typo * fix: checkout files in app directory * fix: increase e2e memory * fix: rm submodules * fix: revert action name * test: mark file offline when external path changes * feat: rename env var to TEST_ENV * docs: new test procedures * feat: can run docker e2e tests manually if needed * chore: use new node 20.8 for e2e * chore: bump exiftool-vendored * feat: simplify test launching * fix: rename env vars to use immich_ prefix * feat: asset folder is submodule * chore: cleanup after 20.8 upgrade * fix: don't log postgres in e2e * fix: better warning about not running all tests --------- Co-authored-by: Jonathan Jogenfors <jonathan@jogenfors.se>
This commit is contained in:
@@ -107,11 +107,12 @@ export type JobItem =
|
||||
| { name: JobName.SEARCH_REMOVE_FACE; data: IAssetFaceJob };
|
||||
|
||||
export type JobHandler<T = any> = (data: T) => boolean | Promise<boolean>;
|
||||
export type JobItemHandler = (item: JobItem) => Promise<void>;
|
||||
|
||||
export const IJobRepository = 'IJobRepository';
|
||||
|
||||
export interface IJobRepository {
|
||||
addHandler(queueName: QueueName, concurrency: number, handler: (job: JobItem) => Promise<void>): void;
|
||||
addHandler(queueName: QueueName, concurrency: number, handler: JobItemHandler): void;
|
||||
setConcurrency(queueName: QueueName, concurrency: number): void;
|
||||
queue(item: JobItem): Promise<void>;
|
||||
pause(name: QueueName): Promise<void>;
|
||||
|
||||
@@ -1172,7 +1172,7 @@ describe(LibraryService.name, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('handleEmptyTrash', () => {
|
||||
describe('handleRemoveOfflineFiles', () => {
|
||||
it('can queue trash deletion jobs', async () => {
|
||||
assetMock.getWith.mockResolvedValue({ items: [assetStub.image1], hasNextPage: false });
|
||||
assetMock.getById.mockResolvedValue(assetStub.image1);
|
||||
|
||||
@@ -363,6 +363,8 @@ export class LibraryService {
|
||||
return false;
|
||||
}
|
||||
|
||||
const normalizedExternalPath = path.normalize(user.externalPath);
|
||||
|
||||
this.logger.verbose(`Refreshing library: ${job.id}`);
|
||||
const crawledAssetPaths = (
|
||||
await this.storageRepository.crawl({
|
||||
@@ -373,7 +375,7 @@ export class LibraryService {
|
||||
.map(path.normalize)
|
||||
.filter((assetPath) =>
|
||||
// Filter out paths that are not within the user's external path
|
||||
assetPath.match(new RegExp(`^${user.externalPath}`)),
|
||||
assetPath.match(new RegExp(`^${normalizedExternalPath}`)),
|
||||
);
|
||||
|
||||
this.logger.debug(`Found ${crawledAssetPaths.length} assets when crawling import paths ${library.importPaths}`);
|
||||
|
||||
Reference in New Issue
Block a user