]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/stats.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / stats.ts
index 9858e2b15a566d0fbed9f1dfc21fc1192f3e6571..c207bb5f00196e649e163458c62766e06d2cbab9 100644 (file)
@@ -1,23 +1,23 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import * as chai from 'chai'
 import 'mocha'
 import { ServerStats } from '../../../../shared/models/server/server-stats.model'
 import {
+  cleanupTests,
   createUser,
   doubleFollow,
   flushAndRunMultipleServers,
   follow,
-  killallServers,
   ServerInfo,
   uploadVideo,
   viewVideo,
   wait
-} from '../../../../shared/utils'
-import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index'
-import { getStats } from '../../../../shared/utils/server/stats'
-import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments'
-import { waitJobs } from '../../../../shared/utils/server/jobs'
+} from '../../../../shared/extra-utils'
+import { setAccessTokensToServers } from '../../../../shared/extra-utils/index'
+import { getStats } from '../../../../shared/extra-utils/server/stats'
+import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments'
+import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
 
 const expect = chai.expect
 
@@ -26,8 +26,6 @@ describe('Test stats (excluding redundancy)', function () {
 
   before(async function () {
     this.timeout(60000)
-
-    await flushTests()
     servers = await flushAndRunMultipleServers(3)
     await setAccessTokensToServers(servers)
 
@@ -37,7 +35,7 @@ describe('Test stats (excluding redundancy)', function () {
       username: 'user1',
       password: 'super_password'
     }
-    await createUser(servers[0].url, servers[0].accessToken, user.username, user.password)
+    await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: user.username, password: user.password })
 
     const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { fixture: 'video_short.webm' })
     const videoUUID = resVideo.body.video.uuid
@@ -75,6 +73,7 @@ describe('Test stats (excluding redundancy)', function () {
     expect(data.totalLocalVideoComments).to.equal(0)
     expect(data.totalLocalVideos).to.equal(0)
     expect(data.totalLocalVideoViews).to.equal(0)
+    expect(data.totalLocalVideoFilesSize).to.equal(0)
     expect(data.totalUsers).to.equal(1)
     expect(data.totalVideoComments).to.equal(1)
     expect(data.totalVideos).to.equal(1)
@@ -97,6 +96,6 @@ describe('Test stats (excluding redundancy)', function () {
   })
 
   after(async function () {
-    killallServers(servers)
+    await cleanupTests(servers)
   })
 })