chore: run all e2e tests on github runners ()

* chore: run all e2e tests on github runners

* fix: use it.each for multi-case test
This commit is contained in:
bo0tzz 2025-05-07 07:42:48 +02:00 committed by GitHub
parent ec6379b0b2
commit 867f6e64f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 25 deletions
.github/workflows
e2e/src/api/specs

View file

@ -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

View file

@ -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 () => {