From c55e3d7227fe1453869e309025996b9d75256d5d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Dec 2021 11:58:15 +0100 Subject: Move test functions outside extra-utils --- server/tests/api/live/live-constraints.ts | 6 +++--- server/tests/api/live/live-permanent.ts | 4 ++-- server/tests/api/live/live-rtmps.ts | 4 ++-- server/tests/api/live/live-save-replay.ts | 6 +++--- server/tests/api/live/live-socket-messages.ts | 4 ++-- server/tests/api/live/live-views.ts | 4 ++-- server/tests/api/live/live.ts | 25 +++++++++++-------------- 7 files changed, 25 insertions(+), 28 deletions(-) (limited to 'server/tests/api/live') diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index 89880c46b..909399836 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts @@ -2,9 +2,9 @@ import 'mocha' import * as chai from 'chai' +import { wait } from '@shared/core-utils' import { VideoPrivacy } from '@shared/models' import { - checkLiveCleanupAfterSave, cleanupTests, ConfigCommand, createMultipleServers, @@ -12,9 +12,9 @@ import { PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, - wait, waitJobs -} from '../../../../shared/server-commands' +} from '@shared/server-commands' +import { checkLiveCleanupAfterSave } from '../../shared' const expect = chai.expect diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts index 12a4d64d8..c2392603b 100644 --- a/server/tests/api/live/live-permanent.ts +++ b/server/tests/api/live/live-permanent.ts @@ -2,6 +2,7 @@ import 'mocha' import * as chai from 'chai' +import { wait } from '@shared/core-utils' import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' import { cleanupTests, @@ -12,9 +13,8 @@ import { setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, - wait, waitJobs -} from '../../../../shared/server-commands' +} from '@shared/server-commands' const expect = chai.expect diff --git a/server/tests/api/live/live-rtmps.ts b/server/tests/api/live/live-rtmps.ts index 31e8f906e..935061971 100644 --- a/server/tests/api/live/live-rtmps.ts +++ b/server/tests/api/live/live-rtmps.ts @@ -2,9 +2,9 @@ import 'mocha' import * as chai from 'chai' +import { buildAbsoluteFixturePath } from '@shared/core-utils' import { VideoPrivacy } from '@shared/models' import { - buildAbsoluteFixturePath, cleanupTests, createSingleServer, PeerTubeServer, @@ -14,7 +14,7 @@ import { stopFfmpeg, testFfmpegStreamError, waitUntilLivePublishedOnAllServers -} from '../../../../shared/server-commands' +} from '@shared/server-commands' const expect = chai.expect diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts index 9fb6b4e54..95a342b01 100644 --- a/server/tests/api/live/live-save-replay.ts +++ b/server/tests/api/live/live-save-replay.ts @@ -3,8 +3,10 @@ import 'mocha' import * as chai from 'chai' import { FfmpegCommand } from 'fluent-ffmpeg' +import { checkLiveCleanupAfterSave } from '@server/tests/shared' +import { wait } from '@shared/core-utils' +import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' import { - checkLiveCleanupAfterSave, cleanupTests, ConfigCommand, createMultipleServers, @@ -14,12 +16,10 @@ import { setDefaultVideoChannel, stopFfmpeg, testFfmpegStreamError, - wait, waitJobs, waitUntilLivePublishedOnAllServers, waitUntilLiveSavedOnAllServers } from '@shared/server-commands' -import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' const expect = chai.expect diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts index 42cf9c5f6..50b16443e 100644 --- a/server/tests/api/live/live-socket-messages.ts +++ b/server/tests/api/live/live-socket-messages.ts @@ -2,6 +2,7 @@ import 'mocha' import * as chai from 'chai' +import { wait } from '@shared/core-utils' import { VideoPrivacy, VideoState } from '@shared/models' import { cleanupTests, @@ -11,10 +12,9 @@ import { setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, - wait, waitJobs, waitUntilLivePublishedOnAllServers -} from '../../../../shared/server-commands' +} from '@shared/server-commands' const expect = chai.expect diff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.ts index 5de4436be..446d0913c 100644 --- a/server/tests/api/live/live-views.ts +++ b/server/tests/api/live/live-views.ts @@ -3,6 +3,7 @@ import 'mocha' import * as chai from 'chai' import { FfmpegCommand } from 'fluent-ffmpeg' +import { wait } from '@shared/core-utils' import { VideoPrivacy } from '@shared/models' import { cleanupTests, @@ -12,10 +13,9 @@ import { setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, - wait, waitJobs, waitUntilLivePublishedOnAllServers -} from '../../../../shared/server-commands' +} from '@shared/server-commands' const expect = chai.expect diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 3869fd6c7..3f9355d2d 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -4,10 +4,18 @@ import 'mocha' import * as chai from 'chai' import { basename, join } from 'path' import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' +import { checkLiveCleanupAfterSave, checkLiveSegmentHash, checkResolutionsInMasterPlaylist, testImage } from '@server/tests/shared' +import { wait } from '@shared/core-utils' +import { + HttpStatusCode, + LiveVideo, + LiveVideoCreate, + VideoDetails, + VideoPrivacy, + VideoState, + VideoStreamingPlaylistType +} from '@shared/models' import { - checkLiveCleanupAfterSave, - checkLiveSegmentHash, - checkResolutionsInMasterPlaylist, cleanupTests, createMultipleServers, doubleFollow, @@ -20,20 +28,9 @@ import { setDefaultVideoChannel, stopFfmpeg, testFfmpegStreamError, - testImage, - wait, waitJobs, waitUntilLivePublishedOnAllServers } from '@shared/server-commands' -import { - HttpStatusCode, - LiveVideo, - LiveVideoCreate, - VideoDetails, - VideoPrivacy, - VideoState, - VideoStreamingPlaylistType -} from '@shared/models' const expect = chai.expect -- cgit v1.2.3