mirror of
https://github.com/immich-app/immich.git
synced 2025-05-23 21:01:30 +02:00
chore: run all e2e tests on github runners (#17987)
* chore: run all e2e tests on github runners * fix: use it.each for multi-case test
This commit is contained in:
parent
ec6379b0b2
commit
867f6e64f9
2 changed files with 15 additions and 25 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -346,7 +346,7 @@ jobs:
|
|||
working-directory: ./e2e
|
||||
strategy:
|
||||
matrix:
|
||||
runner: [mich, ubuntu-24.04-arm]
|
||||
runner: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
@ -394,7 +394,7 @@ jobs:
|
|||
working-directory: ./e2e
|
||||
strategy:
|
||||
matrix:
|
||||
runner: [mich, ubuntu-24.04-arm]
|
||||
runner: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
|
@ -1085,31 +1085,21 @@ describe('/asset', () => {
|
|||
},
|
||||
];
|
||||
|
||||
it(`should upload and generate a thumbnail for different file types`, async () => {
|
||||
// upload in parallel
|
||||
const assets = await Promise.all(
|
||||
tests.map(async ({ input }) => {
|
||||
const filepath = join(testAssetDir, input);
|
||||
return utils.createAsset(admin.accessToken, {
|
||||
assetData: { bytes: await readFile(filepath), filename: basename(filepath) },
|
||||
});
|
||||
}),
|
||||
);
|
||||
it.each(tests)(`should upload and generate a thumbnail for different file types`, async ({ input, expected }) => {
|
||||
const filepath = join(testAssetDir, input);
|
||||
const response = await utils.createAsset(admin.accessToken, {
|
||||
assetData: { bytes: await readFile(filepath), filename: basename(filepath) },
|
||||
});
|
||||
|
||||
for (const { id, status } of assets) {
|
||||
expect(status).toBe(AssetMediaStatus.Created);
|
||||
// longer timeout as the thumbnail generation from full-size raw files can take a while
|
||||
await utils.waitForWebsocketEvent({ event: 'assetUpload', id });
|
||||
}
|
||||
expect(response.status).toBe(AssetMediaStatus.Created);
|
||||
const id = response.id;
|
||||
// longer timeout as the thumbnail generation from full-size raw files can take a while
|
||||
await utils.waitForWebsocketEvent({ event: 'assetUpload', id });
|
||||
|
||||
for (const [i, { id }] of assets.entries()) {
|
||||
const { expected } = tests[i];
|
||||
const asset = await utils.getAssetInfo(admin.accessToken, id);
|
||||
|
||||
expect(asset.exifInfo).toBeDefined();
|
||||
expect(asset.exifInfo).toMatchObject(expected.exifInfo);
|
||||
expect(asset).toMatchObject(expected);
|
||||
}
|
||||
const asset = await utils.getAssetInfo(admin.accessToken, id);
|
||||
expect(asset.exifInfo).toBeDefined();
|
||||
expect(asset.exifInfo).toMatchObject(expected.exifInfo);
|
||||
expect(asset).toMatchObject(expected);
|
||||
});
|
||||
|
||||
it('should handle a duplicate', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue