joblog="$jobname-ci.log"
- parallel -j $jobs \
+ parallel -j $jobs --retries $retries \
"echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail {}" \
::: $files
}
if [ "$1" = "misc" ]; then
- npm run build -- --light
+ npm run build
feedsFiles=$(findTestFiles server/tests/feeds)
helperFiles=$(findTestFiles server/tests/helpers)
})
it('Should fail to update a live if it has already started', async function () {
- this.timeout(20000)
+ this.timeout(40000)
const resLive = await getLive(server.url, server.accessToken, videoId)
const live: LiveVideo = resLive.body
})
it('Should fail to stream twice in the save live', async function () {
- this.timeout(30000)
+ this.timeout(40000)
const resLive = await getLive(server.url, server.accessToken, videoId)
const live: LiveVideo = resLive.body
await makeUploadRequest({
method: 'PUT',
url: server.url,
- path: path + '4da6fde3-88f7-4d16-b119-108df563d0b06/captions',
+ path: path + '4da6fde3-88f7-4d16-b119-108df563d0b06/captions/fr',
token: server.accessToken,
fields,
attaches
await makeUploadRequest({
method: 'PUT',
url: server.url,
- path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions',
+ path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions/fr',
token: server.accessToken,
fields,
- attaches
+ attaches,
+ statusCodeExpected: 404
})
})
updateLive,
wait,
waitJobs,
- waitUntilLivePublished
+ waitUntilLivePublished,
+ waitUntilLiveWaiting
} from '../../../../shared/extra-utils'
const expect = chai.expect
})
it('Should stream into this permanent live', async function () {
- this.timeout(40000)
+ this.timeout(60000)
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID)
await checkVideoState(videoUUID, VideoState.PUBLISHED)
await stopFfmpeg(command)
+ await waitUntilLiveWaiting(servers[0].url, servers[0].accessToken, videoUUID)
await waitJobs(servers)
})
})
it('Should correctly delete the video files after the stream ended', async function () {
- this.timeout(30000)
+ this.timeout(40000)
await stopFfmpeg(ffmpegCommand)
await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200)
await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED)
+ await waitJobs(servers)
+
// No resolutions saved since we did not save replay
await checkLiveCleanup(servers[0], liveVideoUUID, [])
})
})
it('Should send unblacklist but not published/subscription notes after unblacklisted if scheduled update pending', async function () {
- this.timeout(20000)
+ this.timeout(40000)
const updateAt = new Date(new Date().getTime() + 1000000)
})
it('Should not send publish/subscription notifications after scheduled update if video still auto-blacklisted', async function () {
- this.timeout(20000)
+ this.timeout(40000)
// In 2 seconds
const updateAt = new Date(new Date().getTime() + 2000)
})
it('Should not send a notification to moderators on new video without auto-blacklist', async function () {
- this.timeout(20000)
+ this.timeout(40000)
const name = 'video without auto-blacklist ' + uuidv4()
})
it('Should not send notifications if the user does not follow the video publisher', async function () {
- this.timeout(30000)
+ this.timeout(50000)
await uploadRandomVideoOnServers(servers, 1)
})
it('Should send a new video notification on a scheduled publication', async function () {
- this.timeout(30000)
+ this.timeout(50000)
// In 2 seconds
const updateAt = new Date(new Date().getTime() + 2000)
})
it('Should not send a notification before the video is published', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const updateAt = new Date(new Date().getTime() + 1000000)
})
it('Should send a new video notification when a video becomes public', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const data = { privacy: VideoPrivacy.PRIVATE }
const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
})
it('Should send a new video notification when a remote video becomes public', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const data = { privacy: VideoPrivacy.PRIVATE }
const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
})
it('Should not send a new video notification when a video becomes unlisted', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const data = { privacy: VideoPrivacy.PRIVATE }
const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
})
it('Should not send a new video notification when a remote video becomes unlisted', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const data = { privacy: VideoPrivacy.PRIVATE }
const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
})
it('Should not send a notification if transcoding is not enabled', async function () {
- this.timeout(30000)
+ this.timeout(50000)
const { name, uuid } = await uploadRandomVideoOnServers(servers, 1)
await waitJobs(servers)
})
it('Should notify when a local channel is following one of our channel', async function () {
- this.timeout(30000)
+ this.timeout(50000)
await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port)
await waitJobs(servers)
})
it('Should notify when a remote channel is following one of our channel', async function () {
- this.timeout(30000)
+ this.timeout(50000)
await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port)
await waitJobs(servers)
// PeerTube does not support accout -> account follows
// it('Should notify when a local account is following one of our channel', async function () {
- // this.timeout(30000)
+ // this.timeout(50000)
//
// await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:' + servers[0].port)
//
// })
// it('Should notify when a remote account is following one of our channel', async function () {
- // this.timeout(30000)
+ // this.timeout(50000)
//
// await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:' + servers[0].port)
//
})
it('Should register user and send verification email if verification required', async function () {
- this.timeout(5000)
+ this.timeout(30000)
+
await updateCustomSubConfig(server.url, server.accessToken, {
signup: {
enabled: true,
let videoUUID: string
before(async function () {
- this.timeout(30000)
+ this.timeout(60000)
servers = await flushAndRunMultipleServers(2)
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import * as chai from 'chai'
import 'mocha'
+import * as chai from 'chai'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
import {
addVideoChannel,
addVideoInPlaylist,
wait,
waitJobs
} from '../../../../shared/extra-utils'
-import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
-import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model'
-import { VideoPrivacy } from '../../../../shared/models/videos'
-import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
-import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
-import { User } from '../../../../shared/models/users'
-import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model'
import {
addAccountToAccountBlocklist,
addAccountToServerBlocklist,
removeServerFromAccountBlocklist,
removeServerFromServerBlocklist
} from '../../../../shared/extra-utils/users/blocklist'
-import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
+import { User } from '../../../../shared/models/users'
+import { VideoPrivacy } from '../../../../shared/models/videos'
+import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
+import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model'
+import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
+import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
+import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model'
const expect = chai.expect
await doubleFollow(servers[0], servers[2])
{
- const serverPromises: Promise<any>[][] = []
+ servers[0].videos = []
+ servers[1].videos = []
+ servers[2].videos = []
for (const server of servers) {
- const videoPromises: Promise<any>[] = []
-
for (let i = 0; i < 7; i++) {
- videoPromises.push(
- uploadVideo(server.url, server.accessToken, { name: `video ${i} server ${server.serverNumber}`, nsfw: false })
- .then(res => res.body.video)
- )
- }
+ const name = `video ${i} server ${server.serverNumber}`
+ const resVideo = await uploadVideo(server.url, server.accessToken, { name, nsfw: false })
- serverPromises.push(videoPromises)
+ server.videos.push(resVideo.body.video)
+ }
}
-
- servers[0].videos = await Promise.all(serverPromises[0])
- servers[1].videos = await Promise.all(serverPromises[1])
- servers[2].videos = await Promise.all(serverPromises[2])
}
nsfwVideoServer1 = (await uploadVideoAndGetId({ server: servers[0], videoName: 'NSFW video', nsfw: true })).id
let videoIdServer2: string
before(async function () {
- this.timeout(50000)
+ this.timeout(120000)
servers = await flushAndRunMultipleServers(2)
await setAccessTokensToServers(servers)
})
it('Should remove a video after a view', async function () {
- this.timeout(20000)
+ this.timeout(40000)
// Should not throw -> video exists
await getVideo(servers[0].url, videoUUID)
let error: Error
try {
- await waitFfmpegUntilError(command, 15000)
+ await waitFfmpegUntilError(command, 25000)
} catch (err) {
error = err
}
return waitUntilLiveState(url, token, videoId, VideoState.PUBLISHED)
}
+function waitUntilLiveWaiting (url: string, token: string, videoId: number | string) {
+ return waitUntilLiveState(url, token, videoId, VideoState.WAITING_FOR_LIVE)
+}
+
function waitUntilLiveEnded (url: string, token: string, videoId: number | string) {
return waitUntilLiveState(url, token, videoId, VideoState.LIVE_ENDED)
}
checkLiveCleanup,
waitUntilLiveSegmentGeneration,
stopFfmpeg,
+ waitUntilLiveWaiting,
sendRTMPStreamInVideo,
waitUntilLiveEnded,
waitFfmpegUntilError,