X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-playlists.ts;h=83a2f3d4d81550a3e926e6af7896477abe41a62b;hb=bec4ea343987c69252b84d02f444c0f033d4a3f9;hp=fc266280865f6562ca1d927e39adfb6b855251a0;hpb=397d78fb3e55aeeedf3591d7be9d7a30849d9e82;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index fc2662808..83a2f3d4d 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts @@ -6,22 +6,23 @@ import { addVideoChannel, addVideoInPlaylist, checkPlaylistFilesWereRemoved, + cleanupTests, createUser, createVideoPlaylist, deleteVideoChannel, deleteVideoPlaylist, - doubleFollow, doVideosExistInMyPlaylist, + doubleFollow, + doVideosExistInMyPlaylist, flushAndRunMultipleServers, - flushTests, getAccountPlaylistsList, - getAccountPlaylistsListWithToken, getMyUserInformation, + getAccountPlaylistsListWithToken, + getMyUserInformation, getPlaylistVideos, getVideoChannelPlaylistsList, getVideoPlaylist, getVideoPlaylistPrivacies, getVideoPlaylistsList, getVideoPlaylistWithToken, - killallServers, removeUser, removeVideoFromPlaylist, reorderVideosPlaylist, @@ -36,7 +37,7 @@ import { uploadVideoAndGetId, userLogin, waitJobs -} from '../../../../shared/utils' +} 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 { Video } from '../../../../shared/models/videos' @@ -357,7 +358,7 @@ describe('Test video playlists', function () { for (const server of servers) { const results = [ - await getAccountPlaylistsList(server.url, 'root@localhost:9002', 0, 5, '-createdAt'), + await getAccountPlaylistsList(server.url, 'root@localhost:' + servers[1].port, 0, 5, '-createdAt'), await getVideoPlaylistsList(server.url, 0, 2, '-createdAt') ] @@ -756,7 +757,7 @@ describe('Test video playlists', function () { this.timeout(30000) for (const server of servers) { - await checkPlaylistFilesWereRemoved(playlistServer1UUID, server.serverNumber) + await checkPlaylistFilesWereRemoved(playlistServer1UUID, server.internalServerNumber) } }) @@ -815,7 +816,12 @@ describe('Test video playlists', function () { this.timeout(30000) const user = { username: 'user_1', password: 'password' } - const res = await createUser(servers[0].url, servers[0].accessToken, user.username, user.password) + const res = await createUser({ + url: servers[ 0 ].url, + accessToken: servers[ 0 ].accessToken, + username: user.username, + password: user.password + }) const userId = res.body.user.id const userAccessToken = await userLogin(servers[0], user) @@ -856,11 +862,6 @@ describe('Test video playlists', function () { }) after(async function () { - killallServers(servers) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } + await cleanupTests(servers) }) })