import { copy } from 'fs-extra'
import { join } from 'path'
import { parallelTests, randomInt, root } from '@shared/core-utils'
-import { Video, VideoChannel, VideoCreateResult, VideoDetails } from '@shared/models'
+import { Video, VideoChannel, VideoChannelSync, VideoCreateResult, VideoDetails } from '@shared/models'
import { BulkCommand } from '../bulk'
import { CLICommand } from '../cli'
import { CustomPagesCommand } from '../custom-pages'
import { OverviewsCommand } from '../overviews'
import { SearchCommand } from '../search'
import { SocketIOCommand } from '../socket'
-import { AccountsCommand, BlocklistCommand, LoginCommand, NotificationsCommand, SubscriptionsCommand, UsersCommand } from '../users'
+import {
+ AccountsCommand,
+ BlocklistCommand,
+ LoginCommand,
+ NotificationsCommand,
+ SubscriptionsCommand,
+ TwoFactorCommand,
+ UsersCommand
+} from '../users'
import {
BlacklistCommand,
CaptionsCommand,
ChangeOwnershipCommand,
ChannelsCommand,
+ ChannelSyncsCommand,
HistoryCommand,
ImportsCommand,
LiveCommand,
PlaylistsCommand,
ServicesCommand,
StreamingPlaylistsCommand,
- VideoEditorCommand,
- VideosCommand
+ VideosCommand,
+ VideoStudioCommand,
+ ViewsCommand
} from '../videos'
import { CommentsCommand } from '../videos/comments-command'
+import { VideoStatsCommand } from '../videos/video-stats-command'
import { ConfigCommand } from './config-command'
import { ContactFormCommand } from './contact-form-command'
import { DebugCommand } from './debug-command'
import { FollowsCommand } from './follows-command'
import { JobsCommand } from './jobs-command'
+import { MetricsCommand } from './metrics-command'
import { ObjectStorageCommand } from './object-storage-command'
import { PluginsCommand } from './plugins-command'
import { RedundancyCommand } from './redundancy-command'
}
channel?: VideoChannel
+ videoChannelSync?: Partial<VideoChannelSync>
video?: Video
videoCreated?: VideoCreateResult
debug?: DebugCommand
follows?: FollowsCommand
jobs?: JobsCommand
+ metrics?: MetricsCommand
plugins?: PluginsCommand
redundancy?: RedundancyCommand
stats?: StatsCommand
playlists?: PlaylistsCommand
history?: HistoryCommand
imports?: ImportsCommand
+ channelSyncs?: ChannelSyncsCommand
streamingPlaylists?: StreamingPlaylistsCommand
channels?: ChannelsCommand
comments?: CommentsCommand
login?: LoginCommand
users?: UsersCommand
objectStorage?: ObjectStorageCommand
- videoEditor?: VideoEditorCommand
+ videoStudio?: VideoStudioCommand
videos?: VideosCommand
+ videoStats?: VideoStatsCommand
+ views?: ViewsCommand
+ twoFactor?: TwoFactorCommand
constructor (options: { serverNumber: number } | { url: string }) {
if ((options as any).url) {
this.port = parseInt(parsed.port)
}
+ getDirectoryPath (directoryName: string) {
+ const testDirectory = 'test' + this.internalServerNumber
+
+ return join(root(), testDirectory, directoryName)
+ }
+
async flushAndRun (configOverride?: Object, options: RunServerOptions = {}) {
await ServersCommand.flushTests(this.internalServerNumber)
suffix: '_test' + this.internalServerNumber
},
storage: {
- tmp: `test${this.internalServerNumber}/tmp/`,
- bin: `test${this.internalServerNumber}/bin/`,
- avatars: `test${this.internalServerNumber}/avatars/`,
- videos: `test${this.internalServerNumber}/videos/`,
- streaming_playlists: `test${this.internalServerNumber}/streaming-playlists/`,
- redundancy: `test${this.internalServerNumber}/redundancy/`,
- logs: `test${this.internalServerNumber}/logs/`,
- previews: `test${this.internalServerNumber}/previews/`,
- thumbnails: `test${this.internalServerNumber}/thumbnails/`,
- torrents: `test${this.internalServerNumber}/torrents/`,
- captions: `test${this.internalServerNumber}/captions/`,
- cache: `test${this.internalServerNumber}/cache/`,
- plugins: `test${this.internalServerNumber}/plugins/`
+ tmp: this.getDirectoryPath('tmp') + '/',
+ bin: this.getDirectoryPath('bin') + '/',
+ avatars: this.getDirectoryPath('avatars') + '/',
+ videos: this.getDirectoryPath('videos') + '/',
+ streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/',
+ redundancy: this.getDirectoryPath('redundancy') + '/',
+ logs: this.getDirectoryPath('logs') + '/',
+ previews: this.getDirectoryPath('previews') + '/',
+ thumbnails: this.getDirectoryPath('thumbnails') + '/',
+ torrents: this.getDirectoryPath('torrents') + '/',
+ captions: this.getDirectoryPath('captions') + '/',
+ cache: this.getDirectoryPath('cache') + '/',
+ plugins: this.getDirectoryPath('plugins') + '/',
+ well_known: this.getDirectoryPath('well-known') + '/'
},
admin: {
email: `admin${this.internalServerNumber}@example.com`
this.debug = new DebugCommand(this)
this.follows = new FollowsCommand(this)
this.jobs = new JobsCommand(this)
+ this.metrics = new MetricsCommand(this)
this.plugins = new PluginsCommand(this)
this.redundancy = new RedundancyCommand(this)
this.stats = new StatsCommand(this)
this.playlists = new PlaylistsCommand(this)
this.history = new HistoryCommand(this)
this.imports = new ImportsCommand(this)
+ this.channelSyncs = new ChannelSyncsCommand(this)
this.streamingPlaylists = new StreamingPlaylistsCommand(this)
this.channels = new ChannelsCommand(this)
this.comments = new CommentsCommand(this)
this.users = new UsersCommand(this)
this.videos = new VideosCommand(this)
this.objectStorage = new ObjectStorageCommand(this)
- this.videoEditor = new VideoEditorCommand(this)
+ this.videoStudio = new VideoStudioCommand(this)
+ this.videoStats = new VideoStatsCommand(this)
+ this.views = new ViewsCommand(this)
+ this.twoFactor = new TwoFactorCommand(this)
}
}