Skip to content

Commit

Permalink
test: temporarily disable flaky audit tests until #7436 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zackpollard committed Mar 20, 2024
1 parent 9c6a26d commit 0063195
Showing 1 changed file with 43 additions and 42 deletions.
85 changes: 43 additions & 42 deletions e2e/src/api/specs/audit.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
import { deleteAssets, getAuditFiles, updateAsset, type LoginResponseDto } from '@immich/sdk';
import { asBearerAuth, utils } from 'src/utils';
import { beforeAll, describe, expect, it } from 'vitest';

describe('/audit', () => {
let admin: LoginResponseDto;

beforeAll(async () => {
await utils.resetDatabase();
await utils.resetFilesystem();

admin = await utils.adminSetup();
});

describe('GET :/file-report', () => {
it('excludes assets without issues from report', async () => {
const [trashedAsset, archivedAsset] = await Promise.all([
utils.createAsset(admin.accessToken),
utils.createAsset(admin.accessToken),
utils.createAsset(admin.accessToken),
]);

await Promise.all([
deleteAssets({ assetBulkDeleteDto: { ids: [trashedAsset.id] } }, { headers: asBearerAuth(admin.accessToken) }),
updateAsset(
{
id: archivedAsset.id,
updateAssetDto: { isArchived: true },
},
{ headers: asBearerAuth(admin.accessToken) },
),
]);

const body = await getAuditFiles({
headers: asBearerAuth(admin.accessToken),
});

expect(body.orphans).toHaveLength(0);
expect(body.extras).toHaveLength(0);
});
});
});
// TODO: Enable these tests again once #7436 is resolved as these were flaky
// import { deleteAssets, getAuditFiles, updateAsset, type LoginResponseDto } from '@immich/sdk';
// import { asBearerAuth, utils } from 'src/utils';
// import { beforeAll, describe, expect, it } from 'vitest';
//
// describe('/audit', () => {
// let admin: LoginResponseDto;
//
// beforeAll(async () => {
// await utils.resetDatabase();
// await utils.resetFilesystem();
//
// admin = await utils.adminSetup();
// });
//
// describe('GET :/file-report', () => {
// it('excludes assets without issues from report', async () => {
// const [trashedAsset, archivedAsset] = await Promise.all([
// utils.createAsset(admin.accessToken),
// utils.createAsset(admin.accessToken),
// utils.createAsset(admin.accessToken),
// ]);
//
// await Promise.all([
// deleteAssets({ assetBulkDeleteDto: { ids: [trashedAsset.id] } }, { headers: asBearerAuth(admin.accessToken) }),
// updateAsset(
// {
// id: archivedAsset.id,
// updateAssetDto: { isArchived: true },
// },
// { headers: asBearerAuth(admin.accessToken) },
// ),
// ]);
//
// const body = await getAuditFiles({
// headers: asBearerAuth(admin.accessToken),
// });
//
// expect(body.orphans).toHaveLength(0);
// expect(body.extras).toHaveLength(0);
// });
// });
// });

0 comments on commit 0063195

Please sign in to comment.