X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fcli%2Fcreate-transcoding-job.ts;h=38b737829129541d4ae6051ad854d744b224a7d8;hb=2fe978744e5b74eb824e4d79c1bb9b840169f125;hp=48302c9e41bd868b86c6979db0bfe3b3eacea574;hpb=e0faa8ad6e18ce6248ef1ec93a59dab5b05be468;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 48302c9e4..38b737829 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' -import { areObjectStorageTestsDisabled } from '@shared/core-utils' +import { expect } from 'chai' +import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, VideoFile } from '@shared/models' import { cleanupTests, @@ -15,17 +15,15 @@ import { } from '@shared/server-commands' import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' -const expect = chai.expect - async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { for (const file of files) { const shouldStartWith = type === 'webtorrent' - ? ObjectStorageCommand.getWebTorrentBaseUrl() - : ObjectStorageCommand.getPlaylistBaseUrl() + ? ObjectStorageCommand.getMockWebTorrentBaseUrl() + : ObjectStorageCommand.getMockPlaylistBaseUrl() expectStartWith(file.fileUrl, shouldStartWith) - await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) + await makeRawRequest({ url: file.fileUrl, expectedStatus: HttpStatusCode.OK_200 }) } } @@ -38,7 +36,7 @@ function runTests (objectStorage: boolean) { this.timeout(120000) const config = objectStorage - ? ObjectStorageCommand.getDefaultConfig() + ? ObjectStorageCommand.getDefaultMockConfig() : {} // Run server 2 to have transcoding enabled @@ -49,7 +47,7 @@ function runTests (objectStorage: boolean) { await doubleFollow(servers[0], servers[1]) - if (objectStorage) await ObjectStorageCommand.prepareDefaultBuckets() + if (objectStorage) await ObjectStorageCommand.prepareDefaultMockBuckets() for (let i = 1; i <= 5; i++) { const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'video' + i } }) @@ -257,7 +255,7 @@ describe('Test create transcoding jobs', function () { }) describe('On object storage', function () { - if (areObjectStorageTestsDisabled()) return + if (areMockObjectStorageTestsDisabled()) return runTests(true) })