X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fstats.ts;h=a9ae236fba03c247414f59ad99cbca0a380c080e;hb=7a4fd56ccd86518a6b14c407fc977c7904337448;hp=be5abad5234eeef043cc6dd347c90fbe1625ec8f;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index be5abad52..a9ae236fb 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts @@ -2,21 +2,21 @@ import 'mocha' import * as chai from 'chai' +import { wait } from '@shared/core-utils' +import { ActivityType, VideoPlaylistPrivacy } from '@shared/models' import { cleanupTests, + createMultipleServers, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, - wait, waitJobs -} from '@shared/extra-utils' -import { ActivityType, VideoPlaylistPrivacy } from '@shared/models' +} from '@shared/server-commands' const expect = chai.expect describe('Test stats (excluding redundancy)', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let channelId const user = { username: 'user1', @@ -26,7 +26,7 @@ describe('Test stats (excluding redundancy)', function () { before(async function () { this.timeout(60000) - servers = await flushAndRunMultipleServers(3) + servers = await createMultipleServers(3) await setAccessTokensToServers(servers) @@ -38,12 +38,12 @@ describe('Test stats (excluding redundancy)', function () { await servers[0].comments.createThread({ videoId: uuid, text: 'comment' }) - await servers[0].videos.view({ id: uuid }) + await servers[0].views.simulateView({ id: uuid }) // Wait the video views repeatable job await wait(8000) - await servers[2].follows.follow({ targets: [ servers[0].url ] }) + await servers[2].follows.follow({ hosts: [ servers[0].url ] }) await waitJobs(servers) }) @@ -198,6 +198,7 @@ describe('Test stats (excluding redundancy)', function () { }, resolutions: { '0p': false, + '144p': false, '240p': false, '360p': false, '480p': false, @@ -229,13 +230,7 @@ describe('Test stats (excluding redundancy)', function () { it('Should have the correct AP stats', async function () { this.timeout(60000) - await servers[0].config.updateCustomSubConfig({ - newConfig: { - transcoding: { - enabled: false - } - } - }) + await servers[0].config.disableTranscoding() const first = await servers[1].stats.get()