Try to fix travis
This commit is contained in:
parent
86ebdf8c46
commit
42e1ec25ec
|
@ -6,9 +6,27 @@ import { join } from 'path'
|
|||
import { UserRole, VideoImport, VideoImportState } from '../../../../shared'
|
||||
|
||||
import {
|
||||
createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
|
||||
makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, flushAndRunServer, ServerInfo, setAccessTokensToServers,
|
||||
updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser
|
||||
blockUser,
|
||||
createUser,
|
||||
deleteMe,
|
||||
flushAndRunServer,
|
||||
getMyUserInformation,
|
||||
getMyUserVideoRating,
|
||||
getUsersList,
|
||||
immutableAssign,
|
||||
killallServers,
|
||||
makeGetRequest,
|
||||
makePostBodyRequest,
|
||||
makePutBodyRequest,
|
||||
makeUploadRequest,
|
||||
registerUser,
|
||||
removeUser,
|
||||
ServerInfo,
|
||||
setAccessTokensToServers,
|
||||
unblockUser,
|
||||
updateUser,
|
||||
uploadVideo,
|
||||
userLogin
|
||||
} from '../../../../shared/extra-utils'
|
||||
import {
|
||||
checkBadCountPagination,
|
||||
|
|
|
@ -4,8 +4,15 @@ import * as chai from 'chai'
|
|||
import 'mocha'
|
||||
import {
|
||||
createUser,
|
||||
flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
|
||||
uploadVideo, userLogin
|
||||
flushAndRunServer,
|
||||
killallServers,
|
||||
makeDeleteRequest,
|
||||
makeGetRequest,
|
||||
makePostBodyRequest,
|
||||
ServerInfo,
|
||||
setAccessTokensToServers,
|
||||
uploadVideo,
|
||||
userLogin
|
||||
} from '../../../../shared/extra-utils'
|
||||
import {
|
||||
checkBadCountPagination,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { flushTests, killallServers, flushAndRunServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils'
|
||||
import { flushAndRunServer, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils'
|
||||
import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews'
|
||||
import { VideosOverview } from '../../../../shared/models/overviews'
|
||||
|
||||
|
|
|
@ -87,12 +87,14 @@ function randomServer () {
|
|||
return Math.floor(Math.random() * (high - low) + low)
|
||||
}
|
||||
|
||||
function flushAndRunServer (serverNumber: number, configOverrideArg?: Object, args = []) {
|
||||
async function flushAndRunServer (serverNumber: number, configOverrideArg?: Object, args = []) {
|
||||
const parallel = process.env.MOCHA_PARALLEL === 'true'
|
||||
|
||||
const internalServerNumber = parallel ? randomServer() : serverNumber
|
||||
const port = 9000 + internalServerNumber
|
||||
|
||||
await flushTests(serverNumber)
|
||||
|
||||
const server: ServerInfo = {
|
||||
app: null,
|
||||
port,
|
||||
|
@ -175,9 +177,6 @@ function flushAndRunServer (serverNumber: number, configOverrideArg?: Object, ar
|
|||
}
|
||||
|
||||
return new Promise<ServerInfo>(res => {
|
||||
flushTests(internalServerNumber)
|
||||
.then(() => {
|
||||
|
||||
server.app = fork(join(root(), 'dist', 'server.js'), args, options)
|
||||
server.app.stdout.on('data', function onStdout (data) {
|
||||
let dontContinue = false
|
||||
|
@ -214,7 +213,6 @@ function flushAndRunServer (serverNumber: number, configOverrideArg?: Object, ar
|
|||
res(server)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function reRunServer (server: ServerInfo, configOverride?: any) {
|
||||
|
|
Loading…
Reference in New Issue