Cleanup tests
This commit is contained in:
parent
9cc8d43e37
commit
210feb6cc4
|
@ -21,7 +21,14 @@ dropRedis () {
|
||||||
redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
|
redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in $(seq 1 6); do
|
seq=$(seq 1 6)
|
||||||
|
|
||||||
|
if [ ! -z ${1+x} ]; then
|
||||||
|
seq=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
for i in $seq; do
|
||||||
recreateDB "$i" &
|
recreateDB "$i" &
|
||||||
dropRedis "$i" &
|
dropRedis "$i" &
|
||||||
removeFiles "$i" &
|
removeFiles "$i" &
|
||||||
|
|
|
@ -22,8 +22,6 @@ describe('Test activitypub', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -61,7 +59,7 @@ describe('Test activitypub', function () {
|
||||||
expect(res.header.location).to.equal('http://localhost:9001/videos/watch/' + videoUUID)
|
expect(res.header.location).to.equal('http://localhost:9001/videos/watch/' + videoUUID)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -81,10 +81,5 @@ describe('Test ActivityPub fetcher', function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
await closeAllSequelize(servers)
|
await closeAllSequelize(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -153,7 +153,7 @@ describe('Test AP refresher', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -180,10 +180,5 @@ describe('Test ActivityPub security', function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
await closeAllSequelize(servers)
|
await closeAllSequelize(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
|
|
||||||
import { flushTests, killallServers, runServer, ServerInfo } from '../../../../shared/extra-utils'
|
import { flushTests, killallServers, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
checkBadCountPagination,
|
checkBadCountPagination,
|
||||||
checkBadSortPagination,
|
checkBadSortPagination,
|
||||||
|
@ -19,9 +19,7 @@ describe('Test accounts API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('When listing accounts', function () {
|
describe('When listing accounts', function () {
|
||||||
|
@ -44,12 +42,7 @@ describe('Test accounts API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -28,8 +28,6 @@ describe('Test blocklist API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
|
||||||
|
@ -487,12 +485,7 @@ describe('Test blocklist API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,7 +5,7 @@ import 'mocha'
|
||||||
import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
|
import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
|
createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, flushAndRunServer, ServerInfo,
|
||||||
setAccessTokensToServers, userLogin, immutableAssign
|
setAccessTokensToServers, userLogin, immutableAssign
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
|
||||||
|
@ -101,8 +101,7 @@ describe('Test config API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -230,12 +229,7 @@ describe('Test config API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
immutableAssign,
|
immutableAssign,
|
||||||
killallServers,
|
killallServers,
|
||||||
reRunServer,
|
reRunServer,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers
|
setAccessTokensToServers
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
@ -34,11 +34,10 @@ describe('Test contact form API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
await MockSmtpServer.Instance.collectEmails(emails)
|
await MockSmtpServer.Instance.collectEmails(emails)
|
||||||
|
|
||||||
// Email is disabled
|
// Email is disabled
|
||||||
server = await runServer(1)
|
server = await flushAndRunServer(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should not accept a contact form if emails are disabled', async function () {
|
it('Should not accept a contact form if emails are disabled', async function () {
|
||||||
|
@ -84,13 +83,8 @@ describe('Test contact form API validators', function () {
|
||||||
await sendContactForm(immutableAssign(defaultBody, { url: server.url }))
|
await sendContactForm(immutableAssign(defaultBody, { url: server.url }))
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
MockSmtpServer.Instance.kill()
|
MockSmtpServer.Instance.kill()
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
createUser,
|
createUser,
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -23,9 +23,7 @@ describe('Test debug API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -67,12 +65,7 @@ describe('Test debug API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers,
|
createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
|
@ -20,8 +20,7 @@ describe('Test server follows API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -296,12 +295,7 @@ describe('Test server follows API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
createUser,
|
createUser,
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -28,9 +28,7 @@ describe('Test jobs API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -82,12 +80,7 @@ describe('Test jobs API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
createUser,
|
createUser,
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -23,9 +23,7 @@ describe('Test logs API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -106,12 +104,7 @@ describe('Test logs API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,7 +23,6 @@ describe('Test server redundancy API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -92,12 +91,7 @@ describe('Test server redundancy API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
|
|
||||||
import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/extra-utils'
|
import { flushTests, immutableAssign, killallServers, makeGetRequest, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
checkBadCountPagination,
|
checkBadCountPagination,
|
||||||
checkBadSortPagination,
|
checkBadSortPagination,
|
||||||
|
@ -17,9 +17,7 @@ describe('Test videos API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('When searching videos', function () {
|
describe('When searching videos', function () {
|
||||||
|
@ -146,12 +144,7 @@ describe('Test videos API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
|
@ -20,9 +20,7 @@ describe('Test services API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
const res = await uploadVideo(server.url, server.accessToken, { name: 'my super name' })
|
const res = await uploadVideo(server.url, server.accessToken, { name: 'my super name' })
|
||||||
|
@ -93,13 +91,8 @@ describe('Test services API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
makePutBodyRequest,
|
makePutBodyRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
wait
|
wait
|
||||||
|
@ -30,9 +30,7 @@ describe('Test user notifications API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -288,12 +286,7 @@ describe('Test user notifications API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
makeDeleteRequest,
|
makeDeleteRequest,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -32,9 +32,7 @@ describe('Test user subscriptions API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -303,12 +301,7 @@ describe('Test user subscriptions API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { UserRole, VideoImport, VideoImportState } from '../../../../shared'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
|
createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
|
||||||
makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers,
|
makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, flushAndRunServer, ServerInfo, setAccessTokensToServers,
|
||||||
updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser
|
updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
|
@ -40,10 +40,8 @@ describe('Test users API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
serverWithRegistrationDisabled = await flushAndRunServer(2)
|
||||||
server = await runServer(1)
|
|
||||||
serverWithRegistrationDisabled = await runServer(2)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -881,12 +879,7 @@ describe('Test users API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server, serverWithRegistrationDisabled ])
|
killallServers([ server, serverWithRegistrationDisabled ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
killallServers,
|
killallServers,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
updateVideoAbuse,
|
updateVideoAbuse,
|
||||||
|
@ -33,9 +33,7 @@ describe('Test video abuses API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -190,12 +188,7 @@ describe('Test video abuses API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -39,7 +39,6 @@ describe('Test video blacklist API validators', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -248,12 +247,7 @@ describe('Test video blacklist API validators', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
makeDeleteRequest,
|
makeDeleteRequest,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makeUploadRequest,
|
makeUploadRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo,
|
uploadVideo,
|
||||||
|
@ -29,9 +29,7 @@ describe('Test video captions API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -271,12 +269,7 @@ describe('Test video captions API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
makePutBodyRequest,
|
makePutBodyRequest,
|
||||||
makeUploadRequest,
|
makeUploadRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -41,9 +41,7 @@ describe('Test video channels API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -312,12 +310,7 @@ describe('Test video channels API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@ import * as chai from 'chai'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import {
|
import {
|
||||||
createUser,
|
createUser,
|
||||||
flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers,
|
flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
|
||||||
uploadVideo, userLogin
|
uploadVideo, userLogin
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
|
@ -29,9 +29,7 @@ describe('Test video comments API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -253,12 +251,7 @@ describe('Test video comments API validator', function () {
|
||||||
it('Should return conflict on comment thread add')
|
it('Should return conflict on comment thread add')
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
makeUploadRequest,
|
makeUploadRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
updateCustomSubConfig,
|
updateCustomSubConfig,
|
||||||
|
@ -38,9 +38,7 @@ describe('Test video imports API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -313,12 +311,7 @@ describe('Test video imports API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
removeVideoFromPlaylist,
|
removeVideoFromPlaylist,
|
||||||
reorderVideosPlaylist,
|
reorderVideosPlaylist,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers, setDefaultVideoChannel,
|
setAccessTokensToServers, setDefaultVideoChannel,
|
||||||
updateVideoPlaylist,
|
updateVideoPlaylist,
|
||||||
|
@ -43,9 +43,7 @@ describe('Test video playlists API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
await setDefaultVideoChannel([ server ])
|
await setDefaultVideoChannel([ server ])
|
||||||
|
@ -670,12 +668,7 @@ describe('Test video playlists API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers, setDefaultVideoChannel,
|
setAccessTokensToServers, setDefaultVideoChannel,
|
||||||
userLogin
|
userLogin
|
||||||
|
@ -48,9 +48,7 @@ describe('Test videos filters', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
await setDefaultVideoChannel([ server ])
|
await setDefaultVideoChannel([ server ])
|
||||||
|
@ -131,12 +129,7 @@ describe('Test videos filters', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
makePostBodyRequest,
|
makePostBodyRequest,
|
||||||
makePutBodyRequest,
|
makePutBodyRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
|
@ -29,9 +29,7 @@ describe('Test videos history API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -128,12 +126,7 @@ describe('Test videos history API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enu
|
||||||
import {
|
import {
|
||||||
createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
|
createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
|
||||||
makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo,
|
makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo,
|
||||||
runServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig
|
flushAndRunServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import {
|
import {
|
||||||
checkBadCountPagination,
|
checkBadCountPagination,
|
||||||
|
@ -33,9 +33,7 @@ describe('Test videos API validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -730,12 +728,7 @@ describe('Test videos API validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -112,8 +112,6 @@ describe('Test users notifications', function () {
|
||||||
|
|
||||||
await MockSmtpServer.Instance.collectEmails(emails)
|
await MockSmtpServer.Instance.collectEmails(emails)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
const overrideConfig = {
|
const overrideConfig = {
|
||||||
smtp: {
|
smtp: {
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
|
@ -1297,7 +1295,7 @@ describe('Test users notifications', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
MockSmtpServer.Instance.kill()
|
MockSmtpServer.Instance.kill()
|
||||||
|
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
|
@ -33,8 +33,6 @@ describe('Test a ActivityPub video channels search', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -207,12 +205,7 @@ describe('Test a ActivityPub video channels search', function () {
|
||||||
expect(res.body.data).to.have.lengthOf(0)
|
expect(res.body.data).to.have.lengthOf(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,8 +30,6 @@ describe('Test a ActivityPub videos search', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -151,12 +149,7 @@ describe('Test a ActivityPub videos search', function () {
|
||||||
expect(res.body.data).to.have.lengthOf(0)
|
expect(res.body.data).to.have.lengthOf(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
advancedVideosSearch,
|
advancedVideosSearch,
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
searchVideo,
|
searchVideo,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
|
@ -24,9 +24,7 @@ describe('Test a videos search', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -407,12 +405,7 @@ describe('Test a videos search', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
getConfig,
|
getConfig,
|
||||||
getCustomConfig,
|
getCustomConfig,
|
||||||
registerUser,
|
registerUser,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
updateCustomConfig
|
updateCustomConfig
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
@ -118,9 +118,7 @@ describe('Test config', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -302,7 +300,7 @@ describe('Test config', function () {
|
||||||
checkInitialConfig(data)
|
checkInitialConfig(data)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils'
|
import { flushTests, killallServers, flushAndRunServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils'
|
||||||
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form'
|
import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form'
|
||||||
|
@ -18,14 +18,12 @@ describe('Test contact form', function () {
|
||||||
|
|
||||||
await MockSmtpServer.Instance.collectEmails(emails)
|
await MockSmtpServer.Instance.collectEmails(emails)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
const overrideConfig = {
|
const overrideConfig = {
|
||||||
smtp: {
|
smtp: {
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server = await runServer(1, overrideConfig)
|
server = await flushAndRunServer(1, overrideConfig)
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -80,7 +78,7 @@ describe('Test contact form', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
MockSmtpServer.Instance.kill()
|
MockSmtpServer.Instance.kill()
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
createUser, removeVideoFromBlacklist,
|
createUser, removeVideoFromBlacklist,
|
||||||
reportVideoAbuse,
|
reportVideoAbuse,
|
||||||
resetPassword,
|
resetPassword,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
unblockUser,
|
unblockUser,
|
||||||
uploadVideo,
|
uploadVideo,
|
||||||
userLogin,
|
userLogin,
|
||||||
|
@ -43,14 +43,12 @@ describe('Test emails', function () {
|
||||||
|
|
||||||
await MockSmtpServer.Instance.collectEmails(emails)
|
await MockSmtpServer.Instance.collectEmails(emails)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
const overrideConfig = {
|
const overrideConfig = {
|
||||||
smtp: {
|
smtp: {
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server = await runServer(1, overrideConfig)
|
server = await flushAndRunServer(1, overrideConfig)
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -258,7 +256,7 @@ describe('Test emails', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
MockSmtpServer.Instance.kill()
|
MockSmtpServer.Instance.kill()
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
|
@ -219,7 +219,7 @@ describe('Test follow constraints', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -189,7 +189,7 @@ describe('Test follows moderation', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -435,7 +435,7 @@ describe('Test follows', function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -296,7 +296,7 @@ describe('Test handle downs', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -56,7 +56,7 @@ describe('Test jobs', function () {
|
||||||
expect(dateIsValid(job.finishedOn)).to.be.true
|
expect(dateIsValid(job.finishedOn)).to.be.true
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers } from '../../../../shared/extra-utils/index'
|
import { flushTests, killallServers, flushAndRunServer, ServerInfo, setAccessTokensToServers } from '../../../../shared/extra-utils/index'
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { uploadVideo } from '../../../../shared/extra-utils/videos/videos'
|
import { uploadVideo } from '../../../../shared/extra-utils/videos/videos'
|
||||||
import { getLogs } from '../../../../shared/extra-utils/logs/logs'
|
import { getLogs } from '../../../../shared/extra-utils/logs/logs'
|
||||||
|
@ -15,9 +15,7 @@ describe('Test logs', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -86,7 +84,7 @@ describe('Test logs', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
killallServers,
|
killallServers,
|
||||||
ServerInfo
|
ServerInfo
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import { runServer } from '../../../../shared/extra-utils/server/servers'
|
import { flushAndRunServer } from '../../../../shared/extra-utils/server/servers'
|
||||||
|
|
||||||
describe('Start and stop server without web client routes', function () {
|
describe('Start and stop server without web client routes', function () {
|
||||||
let server: ServerInfo
|
let server: ServerInfo
|
||||||
|
@ -13,9 +13,7 @@ describe('Start and stop server without web client routes', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1, {}, ['--no-client'])
|
||||||
|
|
||||||
server = await runServer(1, {}, ['--no-client'])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should fail getting the client', function () {
|
it('Should fail getting the client', function () {
|
||||||
|
@ -25,12 +23,7 @@ describe('Start and stop server without web client routes', function () {
|
||||||
return req.expect(404)
|
return req.expect(404)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -21,7 +21,7 @@ const expect = chai.expect
|
||||||
import {
|
import {
|
||||||
getConfig,
|
getConfig,
|
||||||
flushTests,
|
flushTests,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
registerUser, getCustomConfig, setAccessTokensToServers, updateCustomConfig
|
registerUser, getCustomConfig, setAccessTokensToServers, updateCustomConfig
|
||||||
} from '../../../../shared/extra-utils/index'
|
} from '../../../../shared/extra-utils/index'
|
||||||
|
|
||||||
|
@ -31,9 +31,7 @@ describe('Test application behind a reverse proxy', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
const { body } = await uploadVideo(server.url, server.accessToken, {})
|
const { body } = await uploadVideo(server.url, server.accessToken, {})
|
||||||
|
@ -102,7 +100,7 @@ describe('Test application behind a reverse proxy', function () {
|
||||||
await userLogin(server, user, 429)
|
await userLogin(server, user, 429)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,8 +26,6 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
servers = await flushAndRunMultipleServers(3)
|
servers = await flushAndRunMultipleServers(3)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
|
||||||
|
@ -97,7 +95,7 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
expect(data.totalInstanceFollowers).to.equal(0)
|
expect(data.totalInstanceFollowers).to.equal(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as magnetUtil from 'magnet-uri'
|
import * as magnetUtil from 'magnet-uri'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import { getVideo, killallServers, reRunServer, runServer, ServerInfo, uploadVideo } from '../../../../shared/extra-utils'
|
import { getVideo, killallServers, reRunServer, flushAndRunServer, ServerInfo, uploadVideo } from '../../../../shared/extra-utils'
|
||||||
import { flushTests, setAccessTokensToServers } from '../../../../shared/extra-utils/index'
|
import { flushTests, setAccessTokensToServers } from '../../../../shared/extra-utils/index'
|
||||||
import { VideoDetails } from '../../../../shared/models/videos'
|
import { VideoDetails } from '../../../../shared/models/videos'
|
||||||
import * as WebTorrent from 'webtorrent'
|
import * as WebTorrent from 'webtorrent'
|
||||||
|
@ -14,9 +14,7 @@ describe('Test tracker', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -84,7 +82,7 @@ describe('Test tracker', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -79,8 +79,6 @@ describe('Test blocklist', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
|
||||||
|
@ -500,12 +498,7 @@ describe('Test blocklist', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this[ 'ok' ]) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -368,7 +368,7 @@ describe('Test users subscriptions', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -235,7 +235,7 @@ describe('Test users with multiple servers', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@ import * as chai from 'chai'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import {
|
import {
|
||||||
registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers,
|
registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers,
|
||||||
userLogin, login, runServer, ServerInfo, verifyEmail, updateCustomSubConfig, wait
|
userLogin, login, flushAndRunServer, ServerInfo, verifyEmail, updateCustomSubConfig, wait
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'
|
import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'
|
||||||
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
||||||
|
@ -32,14 +32,12 @@ describe('Test users account verification', function () {
|
||||||
|
|
||||||
await MockSmtpServer.Instance.collectEmails(emails)
|
await MockSmtpServer.Instance.collectEmails(emails)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
const overrideConfig = {
|
const overrideConfig = {
|
||||||
smtp: {
|
smtp: {
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server = await runServer(1, overrideConfig)
|
server = await flushAndRunServer(1, overrideConfig)
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -122,13 +120,8 @@ describe('Test users account verification', function () {
|
||||||
await userLogin(server, user2)
|
await userLogin(server, user2)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
MockSmtpServer.Instance.kill()
|
MockSmtpServer.Instance.kill()
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this[ 'ok' ]) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
registerUser,
|
registerUser,
|
||||||
removeUser,
|
removeUser,
|
||||||
removeVideo,
|
removeVideo,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
testImage,
|
testImage,
|
||||||
unblockUser,
|
unblockUser,
|
||||||
|
@ -54,9 +54,7 @@ describe('Test users', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -679,12 +677,7 @@ describe('Test users', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this[ 'ok' ]) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1029,12 +1029,7 @@ describe('Test multiple servers', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
} from '../../../../shared/extra-utils/index'
|
} from '../../../../shared/extra-utils/index'
|
||||||
import { runServer } from '../../../../shared/extra-utils/server/servers'
|
import { flushAndRunServer } from '../../../../shared/extra-utils/server/servers'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
@ -21,9 +21,7 @@ describe('Test services', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -76,7 +74,7 @@ describe('Test services', function () {
|
||||||
expect(res.body).to.not.have.property('thumbnail_height')
|
expect(res.body).to.not.have.property('thumbnail_height')
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
killallServers,
|
killallServers,
|
||||||
rateVideo,
|
rateVideo,
|
||||||
removeVideo,
|
removeVideo,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
testImage,
|
testImage,
|
||||||
|
@ -107,9 +107,7 @@ describe('Test a single server', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -426,12 +424,7 @@ describe('Test a single server', function () {
|
||||||
expect(video.dislikes).to.equal(1)
|
expect(video.dislikes).to.equal(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -172,7 +172,7 @@ describe('Test video abuses', function () {
|
||||||
expect(res.body.data.length).to.equal(0)
|
expect(res.body.data.length).to.equal(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -425,7 +425,7 @@ describe('Test video blacklist', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,8 +29,6 @@ describe('Test video captions', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -197,7 +195,7 @@ describe('Test video captions', function () {
|
||||||
await checkVideoFilesWereRemoved(videoUUID, 1)
|
await checkVideoFilesWereRemoved(videoUUID, 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,19 +5,20 @@ import 'mocha'
|
||||||
import {
|
import {
|
||||||
acceptChangeOwnership,
|
acceptChangeOwnership,
|
||||||
changeVideoOwnership,
|
changeVideoOwnership,
|
||||||
createUser, doubleFollow, flushAndRunMultipleServers,
|
createUser,
|
||||||
flushTests,
|
doubleFollow,
|
||||||
|
flushAndRunMultipleServers,
|
||||||
|
flushAndRunServer,
|
||||||
getMyUserInformation,
|
getMyUserInformation,
|
||||||
|
getVideo,
|
||||||
getVideoChangeOwnershipList,
|
getVideoChangeOwnershipList,
|
||||||
getVideosList,
|
getVideosList,
|
||||||
killallServers,
|
killallServers,
|
||||||
refuseChangeOwnership,
|
refuseChangeOwnership,
|
||||||
runServer,
|
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo,
|
uploadVideo,
|
||||||
userLogin,
|
userLogin
|
||||||
getVideo
|
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { User } from '../../../../shared/models/users'
|
import { User } from '../../../../shared/models/users'
|
||||||
|
@ -202,7 +203,7 @@ describe('Test video change ownership - nominal', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -225,8 +226,7 @@ describe('Test video change ownership - quota too small', function () {
|
||||||
this.timeout(50000)
|
this.timeout(50000)
|
||||||
|
|
||||||
// Run one server
|
// Run one server
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([server])
|
await setAccessTokensToServers([server])
|
||||||
|
|
||||||
const videoQuota = 42000000
|
const videoQuota = 42000000
|
||||||
|
@ -297,7 +297,7 @@ describe('Test video change ownership - quota too small', function () {
|
||||||
await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId, 403)
|
await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId, 403)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([server])
|
killallServers([server])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -42,8 +42,6 @@ describe('Test video channels', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -279,7 +277,7 @@ describe('Test video channels', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
dateIsValid,
|
dateIsValid,
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
updateMyAvatar,
|
updateMyAvatar,
|
||||||
|
@ -34,9 +34,7 @@ describe('Test video comments', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -201,7 +199,7 @@ describe('Test video comments', function () {
|
||||||
expect(res.body.data[1].totalReplies).to.equal(0)
|
expect(res.body.data[1].totalReplies).to.equal(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -99,7 +99,7 @@ describe('Test video description', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -128,12 +128,7 @@ describe('Test HLS videos', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -241,7 +241,7 @@ describe('Test video imports', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
getMyUserInformation,
|
getMyUserInformation,
|
||||||
getVideoChannelVideos,
|
getVideoChannelVideos,
|
||||||
getVideosListWithToken,
|
getVideosListWithToken,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
searchVideo,
|
searchVideo,
|
||||||
searchVideoWithToken,
|
searchVideoWithToken,
|
||||||
updateCustomConfig,
|
updateCustomConfig,
|
||||||
|
@ -64,9 +64,7 @@ describe('Test video NSFW policy', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(50000)
|
this.timeout(50000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
// Get the access tokens
|
// Get the access tokens
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
@ -243,7 +241,7 @@ describe('Test video NSFW policy', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -860,12 +860,7 @@ describe('Test video playlists', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -152,7 +152,7 @@ describe('Test video privacy', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -165,7 +165,7 @@ describe('Test video update scheduler', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -349,7 +349,7 @@ describe('Test video transcoding', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -55,8 +55,6 @@ describe('Test videos filter validator', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -121,12 +119,7 @@ describe('Test videos filter validator', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
getVideosListWithToken,
|
getVideosListWithToken,
|
||||||
getVideoWithToken,
|
getVideoWithToken,
|
||||||
killallServers, reRunServer,
|
killallServers, reRunServer,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
searchVideoWithToken,
|
searchVideoWithToken,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
|
@ -33,9 +33,7 @@ describe('Test videos history', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
|
@ -222,12 +220,7 @@ describe('Test videos history', function () {
|
||||||
expect(res.body.total).to.equal(0)
|
expect(res.body.total).to.equal(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils'
|
import { flushTests, killallServers, flushAndRunServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils'
|
||||||
import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews'
|
import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews'
|
||||||
import { VideosOverview } from '../../../../shared/models/overviews'
|
import { VideosOverview } from '../../../../shared/models/overviews'
|
||||||
|
|
||||||
|
@ -14,9 +14,7 @@ describe('Test a videos overview', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
@ -89,12 +87,7 @@ describe('Test a videos overview', function () {
|
||||||
expect(overview.channels[0].channel.name).to.equal('root_channel')
|
expect(overview.channels[0].channel.name).to.equal('root_channel')
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
reRunServer,
|
reRunServer,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs
|
uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs
|
||||||
|
@ -27,8 +27,6 @@ describe('Test video views cleaner', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(50000)
|
this.timeout(50000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
|
||||||
|
@ -102,12 +100,7 @@ describe('Test video views cleaner', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -39,7 +39,6 @@ describe('Test create import video jobs', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(90000)
|
this.timeout(90000)
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
// Run server 2 to have transcoding enabled
|
// Run server 2 to have transcoding enabled
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
|
@ -131,7 +130,7 @@ describe('Test create import video jobs', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -28,8 +28,6 @@ describe('Test create transcoding jobs', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
// Run server 2 to have transcoding enabled
|
// Run server 2 to have transcoding enabled
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -126,7 +124,7 @@ describe('Test create transcoding jobs', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -31,8 +31,6 @@ describe('Test optimize old videos', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(200000)
|
this.timeout(200000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
// Run server 2 to have transcoding enabled
|
// Run server 2 to have transcoding enabled
|
||||||
servers = await flushAndRunMultipleServers(2)
|
servers = await flushAndRunMultipleServers(2)
|
||||||
await setAccessTokensToServers(servers)
|
await setAccessTokensToServers(servers)
|
||||||
|
@ -114,7 +112,7 @@ describe('Test optimize old videos', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
flushTests,
|
flushTests,
|
||||||
getEnvCli,
|
getEnvCli,
|
||||||
killallServers,
|
killallServers,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers
|
setAccessTokensToServers
|
||||||
} from '../../../shared/extra-utils'
|
} from '../../../shared/extra-utils'
|
||||||
|
@ -19,9 +19,7 @@ describe('Test CLI wrapper', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' })
|
await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' })
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
getEnvCli,
|
getEnvCli,
|
||||||
killallServers,
|
killallServers,
|
||||||
login,
|
login,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers
|
setAccessTokensToServers
|
||||||
} from '../../../shared/extra-utils'
|
} from '../../../shared/extra-utils'
|
||||||
|
@ -17,9 +17,7 @@ describe('Test reset password scripts', function () {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
server = await flushAndRunServer(1)
|
||||||
await flushTests()
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' })
|
await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' })
|
||||||
|
@ -34,7 +32,7 @@ describe('Test reset password scripts', function () {
|
||||||
await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, 200)
|
await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
killallServers,
|
killallServers,
|
||||||
makeActivityPubGetRequest,
|
makeActivityPubGetRequest,
|
||||||
parseTorrentVideo,
|
parseTorrentVideo,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
|
@ -32,15 +32,13 @@ describe('Test update host scripts', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(60000)
|
||||||
|
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
const overrideConfig = {
|
const overrideConfig = {
|
||||||
webserver: {
|
webserver: {
|
||||||
port: 9256
|
port: 9256
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Run server 2 to have transcoding enabled
|
// Run server 2 to have transcoding enabled
|
||||||
server = await runServer(2, overrideConfig)
|
server = await flushAndRunServer(2, overrideConfig)
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
|
|
||||||
// Upload two videos for our needs
|
// Upload two videos for our needs
|
||||||
|
@ -72,7 +70,7 @@ describe('Test update host scripts', function () {
|
||||||
|
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
// Run server with standard configuration
|
// Run server with standard configuration
|
||||||
server = await runServer(2)
|
server = await flushAndRunServer(2)
|
||||||
|
|
||||||
const env = getEnvCli(server)
|
const env = getEnvCli(server)
|
||||||
await execCLI(`${env} npm run update-host`)
|
await execCLI(`${env} npm run update-host`)
|
||||||
|
@ -148,7 +146,7 @@ describe('Test update host scripts', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
getVideosList,
|
getVideosList,
|
||||||
killallServers,
|
killallServers,
|
||||||
makeHTMLRequest,
|
makeHTMLRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
serverLogin,
|
serverLogin,
|
||||||
updateCustomConfig,
|
updateCustomConfig,
|
||||||
|
@ -31,9 +31,7 @@ describe('Test a client controllers', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
server.accessToken = await serverLogin(server)
|
server.accessToken = await serverLogin(server)
|
||||||
|
|
||||||
const videoAttributes = {
|
const videoAttributes = {
|
||||||
|
@ -147,7 +145,7 @@ describe('Test a client controllers', function () {
|
||||||
checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }')
|
checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }')
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -207,12 +207,7 @@ describe('Test syndication feeds', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers(servers)
|
killallServers(servers)
|
||||||
|
|
||||||
// Keep the logs if the test failed
|
|
||||||
if (this['ok']) {
|
|
||||||
await flushTests()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
flushTests,
|
flushTests,
|
||||||
killallServers,
|
killallServers,
|
||||||
makeGetRequest,
|
makeGetRequest,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
|
@ -23,9 +23,7 @@ describe('Test misc endpoints', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
await flushTests()
|
server = await flushAndRunServer(1)
|
||||||
|
|
||||||
server = await runServer(1)
|
|
||||||
await setAccessTokensToServers([ server ])
|
await setAccessTokensToServers([ server ])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -173,7 +171,7 @@ describe('Test misc endpoints', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(function () {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
getVideosList,
|
getVideosList,
|
||||||
killallServers,
|
killallServers,
|
||||||
rateVideo,
|
rateVideo,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
uploadVideo
|
uploadVideo
|
||||||
|
@ -19,11 +19,10 @@ start()
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
async function start () {
|
async function start () {
|
||||||
await flushTests()
|
|
||||||
|
|
||||||
console.log('Flushed tests.')
|
console.log('Flushed tests.')
|
||||||
|
|
||||||
const server = await runServer(6)
|
const server = await flushAndRunServer(6)
|
||||||
|
|
||||||
process.on('exit', async () => {
|
process.on('exit', async () => {
|
||||||
killallServers([ server ])
|
killallServers([ server ])
|
||||||
|
|
|
@ -58,18 +58,17 @@ function flushAndRunMultipleServers (totalServers: number, configOverride?: Obje
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flushTests()
|
|
||||||
.then(() => {
|
|
||||||
for (let j = 1; j <= totalServers; j++) {
|
for (let j = 1; j <= totalServers; j++) {
|
||||||
runServer(j, configOverride).then(app => anotherServerDone(j, app))
|
flushAndRunServer(j, configOverride).then(app => anotherServerDone(j, app))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flushTests () {
|
function flushTests (serverNumber?: number) {
|
||||||
return new Promise<void>((res, rej) => {
|
return new Promise<void>((res, rej) => {
|
||||||
return exec('npm run clean:server:test', err => {
|
const suffix = serverNumber ? ` -- ${serverNumber}` : ''
|
||||||
|
|
||||||
|
return exec('npm run clean:server:test' + suffix, err => {
|
||||||
if (err) return rej(err)
|
if (err) return rej(err)
|
||||||
|
|
||||||
return res()
|
return res()
|
||||||
|
@ -77,7 +76,7 @@ function flushTests () {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function runServer (serverNumber: number, configOverride?: Object, args = []) {
|
function flushAndRunServer (serverNumber: number, configOverride?: Object, args = []) {
|
||||||
const server: ServerInfo = {
|
const server: ServerInfo = {
|
||||||
app: null,
|
app: null,
|
||||||
serverNumber: serverNumber,
|
serverNumber: serverNumber,
|
||||||
|
@ -123,26 +122,29 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise<ServerInfo>(res => {
|
return new Promise<ServerInfo>(res => {
|
||||||
|
flushTests(serverNumber)
|
||||||
|
.then(() => {
|
||||||
|
|
||||||
server.app = fork(join(root(), 'dist', 'server.js'), args, options)
|
server.app = fork(join(root(), 'dist', 'server.js'), args, options)
|
||||||
server.app.stdout.on('data', function onStdout (data) {
|
server.app.stdout.on('data', function onStdout (data) {
|
||||||
let dontContinue = false
|
let dontContinue = false
|
||||||
|
|
||||||
// Capture things if we want to
|
// Capture things if we want to
|
||||||
for (const key of Object.keys(regexps)) {
|
for (const key of Object.keys(regexps)) {
|
||||||
const regexp = regexps[key]
|
const regexp = regexps[ key ]
|
||||||
const matches = data.toString().match(regexp)
|
const matches = data.toString().match(regexp)
|
||||||
if (matches !== null) {
|
if (matches !== null) {
|
||||||
if (key === 'client_id') server.client.id = matches[1]
|
if (key === 'client_id') server.client.id = matches[ 1 ]
|
||||||
else if (key === 'client_secret') server.client.secret = matches[1]
|
else if (key === 'client_secret') server.client.secret = matches[ 1 ]
|
||||||
else if (key === 'user_username') server.user.username = matches[1]
|
else if (key === 'user_username') server.user.username = matches[ 1 ]
|
||||||
else if (key === 'user_password') server.user.password = matches[1]
|
else if (key === 'user_password') server.user.password = matches[ 1 ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if all required sentences are here
|
// Check if all required sentences are here
|
||||||
for (const key of Object.keys(serverRunString)) {
|
for (const key of Object.keys(serverRunString)) {
|
||||||
if (data.toString().indexOf(key) !== -1) serverRunString[key] = true
|
if (data.toString().indexOf(key) !== -1) serverRunString[ key ] = true
|
||||||
if (serverRunString[key] === false) dontContinue = true
|
if (serverRunString[ key ] === false) dontContinue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no, there is maybe one thing not already initialized (client/user credentials generation...)
|
// If no, there is maybe one thing not already initialized (client/user credentials generation...)
|
||||||
|
@ -153,17 +155,18 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) {
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
try {
|
try {
|
||||||
process.kill(server.app.pid)
|
process.kill(server.app.pid)
|
||||||
} catch { /* empty */ }
|
} catch { /* empty */
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
res(server)
|
res(server)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reRunServer (server: ServerInfo, configOverride?: any) {
|
async function reRunServer (server: ServerInfo, configOverride?: any) {
|
||||||
const newServer = await runServer(server.serverNumber, configOverride)
|
const newServer = await flushAndRunServer(server.serverNumber, configOverride)
|
||||||
server.app = newServer.app
|
server.app = newServer.app
|
||||||
|
|
||||||
return server
|
return server
|
||||||
|
@ -212,7 +215,7 @@ export {
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
flushAndRunMultipleServers,
|
flushAndRunMultipleServers,
|
||||||
flushTests,
|
flushTests,
|
||||||
runServer,
|
flushAndRunServer,
|
||||||
killallServers,
|
killallServers,
|
||||||
reRunServer,
|
reRunServer,
|
||||||
waitUntilLog
|
waitUntilLog
|
||||||
|
|
Loading…
Reference in New Issue