-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: temporarily disable flaky audit tests until #7436 is fixed
- Loading branch information
1 parent
9c6a26d
commit 0063195
Showing
1 changed file
with
43 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
// }); | ||
// }); | ||
// }); |