From 11458a747cb0f596577a73ca331f2de68d07c0b2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 12 Feb 2024 11:22:51 +0100 Subject: [PATCH] Fix CI tests --- .../src/api/object-storage/video-static-file-privacy.ts | 8 +++++++- packages/tests/src/api/server/reverse-proxy.ts | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/tests/src/api/object-storage/video-static-file-privacy.ts b/packages/tests/src/api/object-storage/video-static-file-privacy.ts index 7a22de926..d3105ffbd 100644 --- a/packages/tests/src/api/object-storage/video-static-file-privacy.ts +++ b/packages/tests/src/api/object-storage/video-static-file-privacy.ts @@ -50,7 +50,13 @@ describe('Object storage for video static file privacy', function () { for (const file of getAllFiles(video)) { const internalFileUrl = await sqlCommand.getInternalFileUrl(file.id) expectStartWith(internalFileUrl, ObjectStorageCommand.getScalewayBaseUrl()) - await makeRawRequest({ url: internalFileUrl, token: server.accessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) + + const { text } = await makeRawRequest({ + url: internalFileUrl, + token: server.accessToken, + expectedStatus: HttpStatusCode.BAD_REQUEST_400 + }) + expect(text).to.contain('Unsupported Authorization Type') } const hls = getHLS(video) diff --git a/packages/tests/src/api/server/reverse-proxy.ts b/packages/tests/src/api/server/reverse-proxy.ts index 7e334cc3e..473412b09 100644 --- a/packages/tests/src/api/server/reverse-proxy.ts +++ b/packages/tests/src/api/server/reverse-proxy.ts @@ -96,8 +96,10 @@ describe('Test application behind a reverse proxy', function () { it('Should rate limit logins', async function () { const user = { username: 'root', password: 'fail' } - for (let i = 0; i < 18; i++) { - await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) + for (let i = 0; i < 20; i++) { + try { + await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) + } catch {} } await server.login.login({ user, expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 })