1
0
Fork 0

Move test functions outside extra-utils

This commit is contained in:
Chocobozzz 2021-12-17 11:58:15 +01:00
parent bf54587a3e
commit c55e3d7227
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
202 changed files with 798 additions and 895 deletions

View File

@ -1,13 +1,13 @@
import express from 'express'
import RateLimit from 'express-rate-limit'
import { logger } from '@server/helpers/logger'
import { buildUUID } from '@shared/core-utils/uuid'
import { CONFIG } from '@server/initializers/config'
import { getAuthNameFromRefreshGrant, getBypassFromExternalAuth, getBypassFromPasswordGrant } from '@server/lib/auth/external-auth'
import { handleOAuthToken } from '@server/lib/auth/oauth'
import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model'
import { Hooks } from '@server/lib/plugins/hooks'
import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares'
import { buildUUID } from '@shared/core-utils'
import { ScopedToken } from '@shared/models/users/user-scoped-token'
const tokensRouter = express.Router()

View File

@ -1,10 +1,10 @@
import express from 'express'
import { join } from 'path'
import { uuidToShort } from '@shared/core-utils/uuid'
import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists'
import { Hooks } from '@server/lib/plugins/hooks'
import { getServerActor } from '@server/models/application/application'
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models'
import { uuidToShort } from '@shared/core-utils'
import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models'
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
import { VideoPlaylistCreate } from '../../../shared/models/videos/playlist/video-playlist-create.model'

View File

@ -1,6 +1,5 @@
import express from 'express'
import { createReqFiles } from '@server/helpers/express-utils'
import { buildUUID, uuidToShort } from '@shared/core-utils/uuid'
import { CONFIG } from '@server/initializers/config'
import { ASSETS_PATH, MIMETYPES } from '@server/initializers/constants'
import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
@ -10,6 +9,7 @@ import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } fro
import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator } from '@server/middlewares/validators/videos/video-live'
import { VideoLiveModel } from '@server/models/video/video-live'
import { MVideoDetails, MVideoFullLight } from '@server/types/models'
import { buildUUID, uuidToShort } from '@shared/core-utils'
import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared'
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
import { logger } from '../../../helpers/logger'

View File

@ -1,9 +1,7 @@
import express from 'express'
import { move } from 'fs-extra'
import { basename } from 'path'
import { getLowercaseExtension } from '@shared/core-utils'
import { getResumableUploadPath } from '@server/helpers/upload'
import { uuidToShort } from '@shared/core-utils/uuid'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
import { generateWebTorrentVideoFilename } from '@server/lib/paths'
@ -20,6 +18,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
import { buildNextVideoState } from '@server/lib/video-state'
import { openapiOperationDoc } from '@server/middlewares/doc'
import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
import { getLowercaseExtension, uuidToShort } from '@shared/core-utils'
import { VideoCreate, VideoState } from '../../../../shared'
import { HttpStatusCode } from '../../../../shared/models'
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'

View File

@ -2,7 +2,7 @@ import 'multer'
import { UploadFilesForCheck } from 'express'
import { sep } from 'path'
import validator from 'validator'
import { isShortUUID, shortToUUID } from '@shared/core-utils/uuid'
import { isShortUUID, shortToUUID } from '@shared/core-utils'
function exists (value: any) {
return value !== undefined && value !== null

View File

@ -1,9 +1,8 @@
import { copy, readFile, remove, rename } from 'fs-extra'
import Jimp, { read } from 'jimp'
import { getLowercaseExtension } from '@shared/core-utils'
import { buildUUID, getLowercaseExtension } from '@shared/core-utils'
import { convertWebPToJPG, processGIF } from './ffmpeg-utils'
import { logger } from './logger'
import { buildUUID } from '@shared/core-utils/uuid'
function generateImageFilename (extension = '.jpg') {
return buildUUID() + extension

View File

@ -4,7 +4,7 @@ import { Request } from 'express'
import { cloneDeep } from 'lodash'
import { BCRYPT_SALT_SIZE, HTTP_SIGNATURE, PRIVATE_RSA_KEY_SIZE } from '../initializers/constants'
import { MActor } from '../types/models'
import { sha256 } from '@shared/core-utils/crypto'
import { sha256 } from '@shared/core-utils/common/crypto'
import { createPrivateKey, getPublicKey, promisify1, promisify2 } from './core-utils'
import { jsonld } from './custom-jsonld-signature'
import { logger } from './logger'

View File

@ -3,7 +3,7 @@ import { Instance as ParseTorrent } from 'parse-torrent'
import { join } from 'path'
import { ResultList } from '../../shared'
import { CONFIG } from '../initializers/config'
import { sha256 } from '@shared/core-utils/crypto'
import { sha256 } from '@shared/core-utils/common/crypto'
import { execPromise, execPromise2, randomBytesPromise } from './core-utils'
import { logger } from './logger'

View File

@ -15,7 +15,7 @@ import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/vide
import { MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist'
import { CONFIG } from '../initializers/config'
import { promisify2 } from './core-utils'
import { sha1 } from '@shared/core-utils/crypto'
import { sha1 } from '@shared/core-utils/common/crypto'
import { logger } from './logger'
import { generateVideoImportTmpPath } from './utils'
import { extractVideo } from './video'

View File

@ -2,7 +2,7 @@ import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
import { randomBytes } from 'crypto'
import { invert } from 'lodash'
import { join } from 'path'
import { randomInt } from '../../shared/core-utils/common/miscs'
import { randomInt, root } from '@shared/core-utils'
import {
AbuseState,
JobType,
@ -18,7 +18,6 @@ import { FollowState } from '../../shared/models/actors'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
import { root } from '../../shared/core-utils'
// Do not use barrels, remain constants as independent as possible
import { isTestInstance, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
import { CONFIG, registerConfigChangedHandler } from './config'

View File

@ -1,4 +1,4 @@
import { buildUUID } from '@shared/core-utils/uuid'
import { buildUUID } from '@shared/core-utils'
import * as Sequelize from 'sequelize'
async function up (utils: {

View File

@ -1,5 +1,5 @@
import * as Sequelize from 'sequelize'
import { buildUUID } from '@shared/core-utils/uuid'
import { buildUUID } from '@shared/core-utils'
import { VideoPlaylistPrivacy, VideoPlaylistType } from '../../../shared/models/videos'
import { WEBSERVER } from '../constants'

View File

@ -1,5 +1,5 @@
import * as Sequelize from 'sequelize'
import { buildUUID } from '@shared/core-utils/uuid'
import { buildUUID } from '@shared/core-utils'
async function up (utils: {
transaction: Sequelize.Transaction

View File

@ -1,9 +1,8 @@
import { getLowercaseExtension } from '@shared/core-utils'
import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc'
import { buildUUID } from '@shared/core-utils/uuid'
import { MIMETYPES } from '@server/initializers/constants'
import { ActorModel } from '@server/models/actor/actor'
import { FilteredModelAttributes } from '@server/types'
import { buildUUID, getLowercaseExtension } from '@shared/core-utils'
import { ActivityPubActor, ActorImageType } from '@shared/models'
function getActorAttributesFromObject (

View File

@ -8,7 +8,7 @@ import {
UnauthorizedClientError,
UnsupportedGrantTypeError
} from 'oauth2-server'
import { sha1 } from '@shared/core-utils/crypto'
import { sha1 } from '@shared/core-utils/common/crypto'
import { randomBytesPromise } from '@server/helpers/core-utils'
import { MOAuthClient } from '@server/types/models'
import { OAUTH_LIFETIME } from '../../initializers/constants'

View File

@ -9,7 +9,7 @@ import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from
import { HttpStatusCode } from '../../shared/models/http/http-error-codes'
import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos'
import { isTestInstance } from '../helpers/core-utils'
import { sha256 } from '@shared/core-utils/crypto'
import { sha256 } from '@shared/core-utils/common/crypto'
import { logger } from '../helpers/logger'
import { mdToPlainText } from '../helpers/markdown'
import { CONFIG } from '../initializers/config'

View File

@ -2,7 +2,7 @@ import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat,
import { flatten, uniq } from 'lodash'
import { basename, dirname, join } from 'path'
import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models'
import { sha256 } from '@shared/core-utils/crypto'
import { sha256 } from '@shared/core-utils/common/crypto'
import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils'
import { logger } from '../helpers/logger'
import { doRequest, doRequestAndSaveToFile } from '../helpers/requests'

View File

@ -2,9 +2,8 @@ import 'multer'
import { queue } from 'async'
import LRUCache from 'lru-cache'
import { join } from 'path'
import { getLowercaseExtension } from '@shared/core-utils'
import { buildUUID } from '@shared/core-utils/uuid'
import { ActorModel } from '@server/models/actor/actor'
import { buildUUID, getLowercaseExtension } from '@shared/core-utils'
import { ActivityPubActorType, ActorImageType } from '@shared/models'
import { retryTransactionWrapper } from '../helpers/database-utils'
import { processImage } from '../helpers/image-utils'

View File

@ -1,9 +1,8 @@
import { join } from 'path'
import { buildUUID } from '@shared/core-utils/uuid'
import { CONFIG } from '@server/initializers/config'
import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
import { removeFragmentedMP4Ext } from '@shared/core-utils'
import { buildUUID, removeFragmentedMP4Ext } from '@shared/core-utils'
// ################## Video file name ##################

View File

@ -1,7 +1,7 @@
import { Transaction } from 'sequelize/types'
import { buildUUID } from '@shared/core-utils/uuid'
import { UserModel } from '@server/models/user/user'
import { MActorDefault } from '@server/types/models/actor'
import { buildUUID } from '@shared/core-utils'
import { ActivityPubActorType } from '../../shared/models/activitypub'
import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users'
import { SERVER_ACTOR_NAME, WEBSERVER } from '../initializers/constants'

View File

@ -1,6 +1,5 @@
import { remove } from 'fs-extra'
import { extname, join } from 'path'
import { buildUUID } from '@shared/core-utils/uuid'
import { extractVideo } from '@server/helpers/video'
import { CONFIG } from '@server/initializers/config'
import {
@ -11,6 +10,7 @@ import {
MVideoFileVideo,
MVideoUUID
} from '@server/types/models'
import { buildUUID } from '@shared/core-utils'
import { VideoStorage } from '@shared/models'
import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage'
import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths'

View File

@ -1,7 +1,7 @@
import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize'
import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
import { uuidToShort } from '@shared/core-utils/uuid'
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'
import { uuidToShort } from '@shared/core-utils'
import { AttributesOnly } from '@shared/typescript-utils'
import { UserNotification, UserNotificationType } from '../../../shared'
import { isBooleanValid } from '../../helpers/custom-validators/misc'

View File

@ -1,7 +1,7 @@
import { uuidToShort } from '@shared/core-utils/uuid'
import { generateMagnetUri } from '@server/helpers/webtorrent'
import { getLocalVideoFileMetadataUrl } from '@server/lib/video-urls'
import { VideoViews } from '@server/lib/video-views'
import { uuidToShort } from '@shared/core-utils'
import { VideoFile, VideosCommonQueryAfterSanitize } from '@shared/models'
import { ActivityTagObject, ActivityUrlObject, VideoObject } from '../../../../shared/models/activitypub/objects'
import { Video, VideoDetails, VideoInclude } from '../../../../shared/models/videos'

View File

@ -15,8 +15,8 @@ import {
Table,
UpdatedAt
} from 'sequelize-typescript'
import { buildUUID } from '@shared/core-utils/uuid'
import { MVideo, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models'
import { buildUUID } from '@shared/core-utils'
import { AttributesOnly } from '@shared/typescript-utils'
import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model'
import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions'

View File

@ -18,8 +18,7 @@ import {
UpdatedAt
} from 'sequelize-typescript'
import { MAccountId, MChannelId } from '@server/types/models'
import { buildPlaylistEmbedPath, buildPlaylistWatchPath, pick } from '@shared/core-utils'
import { buildUUID, uuidToShort } from '@shared/core-utils/uuid'
import { buildPlaylistEmbedPath, buildPlaylistWatchPath, buildUUID, pick, uuidToShort } from '@shared/core-utils'
import { AttributesOnly } from '@shared/typescript-utils'
import { ActivityIconObject } from '../../../shared/models/activitypub/objects'
import { PlaylistObject } from '../../../shared/models/activitypub/objects/playlist-object'

View File

@ -21,7 +21,7 @@ import { MStreamingPlaylist, MVideo } from '@server/types/models'
import { AttributesOnly } from '@shared/typescript-utils'
import { VideoStorage } from '@shared/models'
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
import { sha1 } from '@shared/core-utils/crypto'
import { sha1 } from '@shared/core-utils/common/crypto'
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
import { isArrayOf } from '../../helpers/custom-validators/misc'
import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos'

View File

@ -32,8 +32,7 @@ import { getHLSDirectory, getHLSRedundancyDirectory } from '@server/lib/paths'
import { VideoPathManager } from '@server/lib/video-path-manager'
import { getServerActor } from '@server/models/application/application'
import { ModelCache } from '@server/models/model-cache'
import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils'
import { uuidToShort } from '@shared/core-utils/uuid'
import { buildVideoEmbedPath, buildVideoWatchPath, pick, uuidToShort } from '@shared/core-utils'
import { VideoFile, VideoInclude } from '@shared/models'
import { AttributesOnly } from '@shared/typescript-utils'
import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared'

View File

@ -2,13 +2,13 @@
import 'mocha'
import * as chai from 'chai'
import { wait } from '@shared/core-utils'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'

View File

@ -2,7 +2,14 @@
import 'mocha'
import * as chai from 'chai'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
const expect = chai.expect

View File

@ -3,7 +3,8 @@
import 'mocha'
import { expect } from 'chai'
import { cloneDeep } from 'lodash'
import { buildAbsoluteFixturePath, buildRequestStub } from '@shared/server-commands'
import { buildRequestStub } from '@server/tests/shared'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { buildSignedActivity } from '../../../helpers/activitypub'
import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto'

View File

@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { wait } from '@shared/core-utils'
import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
@ -9,10 +11,8 @@ import {
PeerTubeServer,
setAccessTokensToServers,
setDefaultVideoChannel,
wait,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
describe('Test AP refresher', function () {
let servers: PeerTubeServer[] = []

View File

@ -6,9 +6,10 @@ import { activityPubContextify, buildSignedActivity } from '@server/helpers/acti
import { buildDigest } from '@server/helpers/peertube-crypto'
import { HTTP_SIGNATURE } from '@server/initializers/constants'
import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils'
import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/server-commands'
import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared'
import { buildAbsoluteFixturePath, wait } from '@shared/core-utils'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createMultipleServers, killallServers, PeerTubeServer } from '@shared/server-commands'
const expect = chai.expect

View File

@ -1,11 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
import {
AbusesCommand,
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
doubleFollow,
@ -15,7 +14,6 @@ import {
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
describe('Test abuses API validators', function () {
const basePath = '/api/v1/abuses/'

View File

@ -1,15 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
PeerTubeServer
} from '@shared/server-commands'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'
describe('Test accounts API validators', function () {
const path = '/api/v1/accounts/'

View File

@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createMultipleServers,
doubleFollow,
@ -14,7 +13,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode } from '@shared/models'
describe('Test blocklist API validators', function () {
let servers: PeerTubeServer[]

View File

@ -1,15 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { MockSmtpServer } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import {
cleanupTests,
ContactFormCommand,
createSingleServer,
killallServers,
MockSmtpServer,
PeerTubeServer
} from '@shared/server-commands'
import { cleanupTests, ContactFormCommand, createSingleServer, killallServers, PeerTubeServer } from '@shared/server-commands'
describe('Test contact form API validators', function () {
let server: PeerTubeServer

View File

@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeDeleteRequest,
@ -13,7 +12,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode } from '@shared/models'
describe('Test server follows API validators', function () {
let server: PeerTubeServer

View File

@ -1,17 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
describe('Test jobs API validators', function () {
const path = '/api/v1/jobs/failed'

View File

@ -2,8 +2,9 @@
import 'mocha'
import { omit } from 'lodash'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
import {
buildAbsoluteFixturePath,
cleanupTests,
createSingleServer,
LiveCommand,
@ -14,7 +15,6 @@ import {
setAccessTokensToServers,
stopFfmpeg
} from '@shared/server-commands'
import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
describe('Test video lives API validator', function () {
const path = '/api/v1/videos/live'

View File

@ -1,22 +1,19 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models'
import {
buildAbsoluteFixturePath,
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
makePutBodyRequest,
makeUploadRequest,
MockSmtpServer,
PeerTubeServer,
setAccessTokensToServers,
UsersCommand
} from '@shared/server-commands'
import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models'
describe('Test my user API validators', function () {
const path = '/api/v1/users/'

View File

@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
@ -13,7 +12,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'
describe('Test server plugins API validators', function () {
let server: PeerTubeServer

View File

@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createMultipleServers,
doubleFollow,
@ -16,7 +15,6 @@ import {
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
describe('Test server redundancy API validators', function () {
let servers: PeerTubeServer[]

View File

@ -1,17 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
return server.config.updateCustomSubConfig({

View File

@ -1,8 +1,15 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { HttpStatusCode, UserRole } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
describe('Test transcoding API validators', function () {
let servers: PeerTubeServer[]

View File

@ -2,18 +2,18 @@
import 'mocha'
import { expect } from 'chai'
import { FIXTURE_URLS } from '@server/tests/shared'
import { randomInt } from '@shared/core-utils'
import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
createSingleServer,
FIXTURE_URLS,
PeerTubeServer,
setAccessTokensToServers,
setDefaultVideoChannel,
VideosCommand,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models'
describe('Test upload quota', function () {
let server: PeerTubeServer

View File

@ -2,20 +2,18 @@
import 'mocha'
import { io } from 'socket.io-client'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
makePostBodyRequest,
makePutBodyRequest,
PeerTubeServer,
setAccessTokensToServers,
wait
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
describe('Test user notifications API validators', function () {
let server: PeerTubeServer

View File

@ -2,9 +2,6 @@
import 'mocha'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeDeleteRequest,
@ -15,6 +12,7 @@ import {
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode } from '@shared/models'
import { checkBadStartPagination, checkBadCountPagination, checkBadSortPagination } from '@server/tests/shared'
describe('Test user subscriptions API validators', function () {
const path = '/api/v1/users/me/subscriptions'

View File

@ -2,21 +2,18 @@
import 'mocha'
import { omit } from 'lodash'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared'
import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
killallServers,
makeGetRequest,
makePostBodyRequest,
makePutBodyRequest,
MockSmtpServer,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
describe('Test users admin API validators', function () {
const path = '/api/v1/users/'

View File

@ -2,15 +2,9 @@
import 'mocha'
import { omit } from 'lodash'
import {
cleanupTests,
createSingleServer,
makePostBodyRequest,
MockSmtpServer,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { MockSmtpServer } from '@server/tests/shared'
import { HttpStatusCode, UserRole } from '@shared/models'
import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
describe('Test users API validators', function () {
const path = '/api/v1/users/'

View File

@ -2,11 +2,10 @@
import 'mocha'
import { expect } from 'chai'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode, VideoBlacklistType } from '@shared/models'
import {
BlacklistCommand,
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createMultipleServers,
doubleFollow,
@ -16,7 +15,6 @@ import {
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, VideoBlacklistType } from '@shared/models'
describe('Test video blacklist API validators', function () {
let servers: PeerTubeServer[]

View File

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
import {
buildAbsoluteFixturePath,
cleanupTests,
createSingleServer,
makeDeleteRequest,
@ -11,7 +12,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
describe('Test video captions API validator', function () {
const path = '/api/v1/videos/'

View File

@ -3,12 +3,11 @@
import 'mocha'
import * as chai from 'chai'
import { omit } from 'lodash'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
import {
buildAbsoluteFixturePath,
ChannelsCommand,
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
@ -18,7 +17,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
const expect = chai.expect

View File

@ -2,10 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeDeleteRequest,
@ -14,7 +13,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
const expect = chai.expect

View File

@ -1,8 +1,15 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { HttpStatusCode, UserRole } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
describe('Test videos files', function () {
let servers: PeerTubeServer[]

View File

@ -2,21 +2,18 @@
import 'mocha'
import { omit } from 'lodash'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
import {
buildAbsoluteFixturePath,
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
FIXTURE_URLS,
makeGetRequest,
makePostBodyRequest,
makeUploadRequest,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
describe('Test video imports API validator', function () {
const path = '/api/v1/videos/imports'

View File

@ -1,18 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
PeerTubeServer,
PlaylistsCommand,
setAccessTokensToServers,
setDefaultVideoChannel
} from '@shared/server-commands'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
import {
HttpStatusCode,
VideoPlaylistCreate,
@ -23,6 +12,15 @@ import {
VideoPlaylistReorder,
VideoPlaylistType
} from '@shared/models'
import {
cleanupTests,
createSingleServer,
makeGetRequest,
PeerTubeServer,
PlaylistsCommand,
setAccessTokensToServers,
setDefaultVideoChannel
} from '@shared/server-commands'
describe('Test video playlists API validator', function () {
let server: PeerTubeServer

View File

@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { checkBadCountPagination, checkBadStartPagination } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import {
checkBadCountPagination,
checkBadStartPagination,
cleanupTests,
createSingleServer,
makeGetRequest,
@ -12,7 +12,6 @@ import {
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode } from '@shared/models'
describe('Test videos history API validator', function () {
const myHistoryPath = '/api/v1/users/me/history/videos'

View File

@ -4,12 +4,10 @@ import 'mocha'
import * as chai from 'chai'
import { omit } from 'lodash'
import { join } from 'path'
import { randomInt } from '@shared/core-utils'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared'
import { randomInt, root } from '@shared/core-utils'
import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination,
checkUploadVideoParam,
cleanupTests,
createSingleServer,
makeDeleteRequest,
@ -17,10 +15,8 @@ import {
makePutBodyRequest,
makeUploadRequest,
PeerTubeServer,
root,
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
const expect = chai.expect

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,8 +2,15 @@
import 'mocha'
import * as chai from 'chai'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { UserNotificationType } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
const expect = chai.expect

View File

@ -3,18 +3,18 @@
import 'mocha'
import * as chai from 'chai'
import { orderBy } from 'lodash'
import { FIXTURE_URLS } from '@server/tests/shared'
import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
import {
BlacklistCommand,
cleanupTests,
createMultipleServers,
doubleFollow,
FIXTURE_URLS,
killallServers,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
const expect = chai.expect

View File

@ -6,14 +6,13 @@ import {
CheckerBaseParams,
checkNewPeerTubeVersion,
checkNewPluginVersion,
cleanupTests,
MockJoinPeerTubeVersions,
MockSmtpServer,
PeerTubeServer,
prepareNotificationsTest,
wait
} from '@shared/server-commands'
prepareNotificationsTest
} from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { PluginType, UserNotification, UserNotificationType } from '@shared/models'
import { cleanupTests, PeerTubeServer } from '@shared/server-commands'
describe('Test admin notifications', function () {
let server: PeerTubeServer

View File

@ -6,13 +6,11 @@ import {
checkCommentMention,
CheckerBaseParams,
checkNewCommentOnMyVideo,
cleanupTests,
MockSmtpServer,
PeerTubeServer,
prepareNotificationsTest,
waitJobs
} from '@shared/server-commands'
prepareNotificationsTest
} from '@server/tests/shared'
import { UserNotification } from '@shared/models'
import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import { buildUUID } from '@shared/core-utils/uuid'
import {
checkAbuseStateChange,
checkAutoInstanceFollowing,
@ -16,15 +15,13 @@ import {
checkUserRegistered,
checkVideoAutoBlacklistForModerators,
checkVideoIsPublished,
cleanupTests,
MockInstancesIndex,
MockSmtpServer,
PeerTubeServer,
prepareNotificationsTest,
wait,
waitJobs
} from '@shared/server-commands'
prepareNotificationsTest
} from '@server/tests/shared'
import { buildUUID, wait } from '@shared/core-utils'
import { AbuseState, CustomConfig, UserNotification, UserRole, VideoPrivacy } from '@shared/models'
import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
describe('Test moderation notifications', function () {
let servers: PeerTubeServer[] = []

View File

@ -5,14 +5,12 @@ import * as chai from 'chai'
import {
CheckerBaseParams,
checkNewVideoFromSubscription,
cleanupTests,
getAllNotificationsSettings,
MockSmtpServer,
PeerTubeServer,
prepareNotificationsTest,
waitJobs
} from '@shared/server-commands'
prepareNotificationsTest
} from '@server/tests/shared'
import { UserNotification, UserNotificationSettingValue } from '@shared/models'
import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,23 +2,20 @@
import 'mocha'
import * as chai from 'chai'
import { buildUUID } from '@shared/core-utils/uuid'
import {
CheckerBaseParams,
checkMyVideoImportIsFinished,
checkNewActorFollow,
checkNewVideoFromSubscription,
checkVideoIsPublished,
cleanupTests,
FIXTURE_URLS,
MockSmtpServer,
PeerTubeServer,
prepareNotificationsTest,
uploadRandomVideoOnServers,
wait,
waitJobs
} from '@shared/server-commands'
uploadRandomVideoOnServers
} from '@server/tests/shared'
import { buildUUID, wait } from '@shared/core-utils'
import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models'
import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -3,11 +3,12 @@
import 'mocha'
import * as chai from 'chai'
import { FfmpegCommand } from 'fluent-ffmpeg'
import { expectStartWith } from '@server/tests/shared'
import { areObjectStorageTestsDisabled } from '@shared/core-utils'
import { HttpStatusCode, LiveVideoCreate, VideoFile, VideoPrivacy } from '@shared/models'
import {
areObjectStorageTestsDisabled,
createMultipleServers,
doubleFollow,
expectStartWith,
killallServers,
makeRawRequest,
ObjectStorageCommand,
@ -19,7 +20,6 @@ import {
waitUntilLivePublishedOnAllServers,
waitUntilLiveSavedOnAllServers
} from '@shared/server-commands'
import { HttpStatusCode, LiveVideoCreate, VideoFile, VideoPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -2,11 +2,11 @@
import 'mocha'
import * as chai from 'chai'
import { expectStartWith, FIXTURE_URLS } from '@server/tests/shared'
import { areObjectStorageTestsDisabled } from '@shared/core-utils'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
import {
areObjectStorageTestsDisabled,
createSingleServer,
expectStartWith,
FIXTURE_URLS,
killallServers,
makeRawRequest,
ObjectStorageCommand,
@ -15,7 +15,6 @@ import {
setDefaultVideoChannel,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -3,25 +3,22 @@
import 'mocha'
import * as chai from 'chai'
import { merge } from 'lodash'
import { checkTmpIsEmpty, expectLogDoesNotContain, expectStartWith, MockObjectStorage } from '@server/tests/shared'
import { areObjectStorageTestsDisabled } from '@shared/core-utils'
import { HttpStatusCode, VideoDetails } from '@shared/models'
import {
areObjectStorageTestsDisabled,
checkTmpIsEmpty,
cleanupTests,
createMultipleServers,
createSingleServer,
doubleFollow,
expectLogDoesNotContain,
expectStartWith,
killallServers,
makeRawRequest,
MockObjectStorage,
ObjectStorageCommand,
PeerTubeServer,
setAccessTokensToServers,
waitJobs,
webtorrentAdd
} from '@shared/server-commands'
import { HttpStatusCode, VideoDetails } from '@shared/models'
const expect = chai.expect

View File

@ -2,8 +2,15 @@
import 'mocha'
import { expect } from 'chai'
import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { VideoPrivacy } from '@shared/models'
import {
cleanupTests,
createSingleServer,
killallServers,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
describe('Test redundancy constraints', function () {
let remoteServer: PeerTubeServer

View File

@ -5,21 +5,8 @@ import * as chai from 'chai'
import { readdir } from 'fs-extra'
import magnetUtil from 'magnet-uri'
import { basename, join } from 'path'
import {
checkSegmentHash,
checkVideoFilesWereRemoved,
cleanupTests,
createMultipleServers,
doubleFollow,
killallServers,
makeRawRequest,
PeerTubeServer,
root,
saveVideoInServers,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { checkSegmentHash, checkVideoFilesWereRemoved, saveVideoInServers } from '@server/tests/shared'
import { root, wait } from '@shared/core-utils'
import {
HttpStatusCode,
VideoDetails,
@ -28,6 +15,16 @@ import {
VideoRedundancyStrategy,
VideoRedundancyStrategyWithManual
} from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
killallServers,
makeRawRequest,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,16 +2,16 @@
import 'mocha'
import * as chai from 'chai'
import { wait } from '@shared/core-utils'
import { VideoChannel } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
PeerTubeServer,
SearchCommand,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { VideoChannel } from '@shared/models'
const expect = chai.expect

View File

@ -2,6 +2,8 @@
import 'mocha'
import * as chai from 'chai'
import { wait } from '@shared/core-utils'
import { VideoPlaylistPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
@ -9,10 +11,8 @@ import {
SearchCommand,
setAccessTokensToServers,
setDefaultVideoChannel,
wait,
waitJobs
} from '@shared/server-commands'
import { VideoPlaylistPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -2,16 +2,16 @@
import 'mocha'
import * as chai from 'chai'
import { wait } from '@shared/core-utils'
import { VideoPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
PeerTubeServer,
SearchCommand,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { VideoPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -10,10 +10,10 @@ import {
SearchCommand,
setAccessTokensToServers,
setDefaultVideoChannel,
stopFfmpeg,
wait
stopFfmpeg
} from '@shared/server-commands'
import { VideoPrivacy } from '@shared/models'
import { wait } from '@shared/core-utils'
const expect = chai.expect

View File

@ -2,15 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import {
cleanupTests,
createMultipleServers,
MockInstancesIndex,
PeerTubeServer,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { MockInstancesIndex } from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,15 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import {
cleanupTests,
createSingleServer,
FIXTURE_URLS,
PeerTubeServer,
setAccessTokensToServers,
setDefaultVideoChannel
} from '@shared/server-commands'
import { FIXTURE_URLS } from '@server/tests/shared'
import { VideoDetails, VideoPrivacy } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,16 +2,16 @@
import 'mocha'
import * as chai from 'chai'
import { parallelTests } from '@shared/core-utils'
import { CustomConfig, HttpStatusCode } from '@shared/models'
import {
cleanupTests,
createSingleServer,
killallServers,
makeGetRequest,
parallelTests,
PeerTubeServer,
setAccessTokensToServers
} from '@shared/server-commands'
import { CustomConfig, HttpStatusCode } from '@shared/models'
const expect = chai.expect

View File

@ -2,17 +2,17 @@
import 'mocha'
import * as chai from 'chai'
import { MockSmtpServer } from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { HttpStatusCode } from '@shared/models'
import {
cleanupTests,
ContactFormCommand,
createSingleServer,
MockSmtpServer,
PeerTubeServer,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode } from '@shared/models'
const expect = chai.expect

View File

@ -2,8 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { MockSmtpServer } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,19 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import {
cleanupTests,
createMultipleServers,
dateIsValid,
expectAccountFollows,
expectChannelsFollows,
PeerTubeServer,
setAccessTokensToServers,
testCaptionFile,
waitJobs
} from '@shared/server-commands'
import { completeVideoCheck, dateIsValid, expectAccountFollows, expectChannelsFollows, testCaptionFile } from '@server/tests/shared'
import { VideoCreateResult, VideoPrivacy } from '@shared/models'
import { completeVideoCheck } from '@server/tests/shared/video'
import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,6 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import { completeVideoCheck } from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
CommentsCommand,
@ -9,11 +12,8 @@ import {
killallServers,
PeerTubeServer,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
import { completeVideoCheck } from '@server/tests/shared/video'
const expect = chai.expect

View File

@ -2,10 +2,10 @@
import 'mocha'
import * as chai from 'chai'
import { dateIsValid } from '@server/tests/shared'
import {
cleanupTests,
createMultipleServers,
dateIsValid,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,

View File

@ -2,17 +2,17 @@
import 'mocha'
import * as chai from 'chai'
import { testHelloWorldRegisteredSettings } from '@server/tests/shared'
import { wait } from '@shared/core-utils'
import { HttpStatusCode, PluginType } from '@shared/models'
import {
cleanupTests,
createSingleServer,
killallServers,
PeerTubeServer,
PluginsCommand,
setAccessTokensToServers,
testHelloWorldRegisteredSettings,
wait
setAccessTokensToServers
} from '@shared/server-commands'
import { HttpStatusCode, PluginType } from '@shared/models'
const expect = chai.expect

View File

@ -2,18 +2,17 @@
import 'mocha'
import * as chai from 'chai'
import { FIXTURE_URLS, MockProxy } from '@server/tests/shared'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
FIXTURE_URLS,
PeerTubeServer,
setAccessTokensToServers,
setDefaultVideoChannel,
waitJobs
} from '@shared/server-commands'
import { MockProxy } from '@shared/server-commands/mock-servers/mock-proxy'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import { expect } from 'chai'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/server-commands'
import { wait } from '@shared/core-utils'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
describe('Test application behind a reverse proxy', function () {
let server: PeerTubeServer

View File

@ -2,8 +2,15 @@
import 'mocha'
import * as chai from 'chai'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { Job } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,16 +2,16 @@
import 'mocha'
import * as chai from 'chai'
import { wait } from '@shared/core-utils'
import { ActivityType, VideoPlaylistPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
wait,
waitJobs
} from '@shared/server-commands'
import { ActivityType, VideoPlaylistPrivacy } from '@shared/models'
const expect = chai.expect

View File

@ -6,16 +6,18 @@ import {
checkActorFilesWereRemoved,
checkTmpIsEmpty,
checkVideoFilesWereRemoved,
saveVideoInServers,
testImage
} from '@server/tests/shared'
import { MyUser } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
saveVideoInServers,
setAccessTokensToServers,
testImage,
waitJobs
} from '@shared/server-commands'
import { MyUser } from '@shared/models'
const expect = chai.expect

View File

@ -2,8 +2,9 @@
import 'mocha'
import * as chai from 'chai'
import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import { MockSmtpServer } from '@server/tests/shared'
import { HttpStatusCode } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
const expect = chai.expect

View File

@ -2,6 +2,8 @@
import 'mocha'
import * as chai from 'chai'
import { testImage } from '@server/tests/shared'
import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'
import {
cleanupTests,
createSingleServer,
@ -9,10 +11,8 @@ import {
makePutBodyRequest,
PeerTubeServer,
setAccessTokensToServers,
testImage,
waitJobs
} from '@shared/server-commands'
import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'
const expect = chai.expect

View File

@ -3,7 +3,14 @@
import 'mocha'
import * as chai from 'chai'
import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils'
import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
import {
cleanupTests,
createMultipleServers,
doubleFollow,
PeerTubeServer,
setAccessTokensToServers,
waitJobs
} from '@shared/server-commands'
const expect = chai.expect

View File

@ -4,23 +4,24 @@ import 'mocha'
import * as chai from 'chai'
import request from 'supertest'
import {
buildAbsoluteFixturePath,
checkTmpIsEmpty,
checkVideoFilesWereRemoved,
completeVideoCheck,
dateIsValid,
saveVideoInServers,
testImage
} from '@server/tests/shared'
import { buildAbsoluteFixturePath, wait } from '@shared/core-utils'
import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
createMultipleServers,
dateIsValid,
doubleFollow,
PeerTubeServer,
saveVideoInServers,
setAccessTokensToServers,
testImage,
wait,
waitJobs,
webtorrentAdd
} from '@shared/server-commands'
import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
import { completeVideoCheck } from '@server/tests/shared/video'
const expect = chai.expect

View File

@ -4,15 +4,9 @@ import 'mocha'
import * as chai from 'chai'
import { pathExists, readdir, stat } from 'fs-extra'
import { join } from 'path'
import {
buildAbsoluteFixturePath,
cleanupTests,
createSingleServer,
PeerTubeServer,
setAccessTokensToServers,
setDefaultVideoChannel
} from '@shared/server-commands'
import { buildAbsoluteFixturePath } from '@shared/core-utils'
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands'
const expect = chai.expect

Some files were not shown because too many files have changed in this diff Show More