import { randomInt } from '../../core-utils/miscs/miscs'
import { VideoChannel } from '../../models/videos'
import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs'
+import { makeGetRequest } from '../requests/requests'
interface ServerInfo {
app: ChildProcess
customConfigFile?: string
accessToken?: string
+ refreshToken?: string
videoChannel?: VideoChannel
video?: {
return server
}
-function checkTmpIsEmpty (server: ServerInfo) {
- return checkDirectoryIsEmpty(server, 'tmp', [ 'plugins-global.css' ])
+async function checkTmpIsEmpty (server: ServerInfo) {
+ await checkDirectoryIsEmpty(server, 'tmp', [ 'plugins-global.css', 'hls' ])
+
+ if (await pathExists(join('test' + server.internalServerNumber, 'tmp', 'hls'))) {
+ await checkDirectoryIsEmpty(server, 'tmp/hls')
+ }
}
async function checkDirectoryIsEmpty (server: ServerInfo, directory: string, exceptions: string[] = []) {
return getFileSize(path)
}
+function makePingRequest (server: ServerInfo) {
+ return makeGetRequest({
+ url: server.url,
+ path: '/api/v1/ping',
+ statusCodeExpected: 200
+ })
+}
+
// ---------------------------------------------------------------------------
export {
cleanupTests,
flushAndRunMultipleServers,
flushTests,
+ makePingRequest,
flushAndRunServer,
killallServers,
reRunServer,