diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-24 15:10:37 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:25 +0200 |
commit | 7c3b79768bd174b22154e8d2df0b1211e01ee56a (patch) | |
tree | 9e45c9302083f0438f7ea174f5fb7d6042be5712 /server/tests/cli | |
parent | 913b1d71e630d5a959c763bf565a171b4dc61434 (diff) | |
download | PeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.tar.gz PeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.tar.zst PeerTube-7c3b79768bd174b22154e8d2df0b1211e01ee56a.zip |
Use test wrapper exit function
Diffstat (limited to 'server/tests/cli')
-rw-r--r-- | server/tests/cli/create-import-video-file-job.ts | 5 | ||||
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 5 | ||||
-rw-r--r-- | server/tests/cli/optimize-old-videos.ts | 5 | ||||
-rw-r--r-- | server/tests/cli/peertube.ts | 4 | ||||
-rw-r--r-- | server/tests/cli/reset-password.ts | 9 | ||||
-rw-r--r-- | server/tests/cli/update-host.ts | 12 |
6 files changed, 21 insertions, 19 deletions
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts index 191d4b460..0d378c1aa 100644 --- a/server/tests/cli/create-import-video-file-job.ts +++ b/server/tests/cli/create-import-video-file-job.ts | |||
@@ -4,6 +4,7 @@ import 'mocha' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { VideoDetails, VideoFile } from '../../../shared/models/videos' | 5 | import { VideoDetails, VideoFile } from '../../../shared/models/videos' |
6 | import { | 6 | import { |
7 | cleanupTests, | ||
7 | doubleFollow, | 8 | doubleFollow, |
8 | execCLI, | 9 | execCLI, |
9 | flushAndRunMultipleServers, | 10 | flushAndRunMultipleServers, |
@@ -130,7 +131,7 @@ describe('Test create import video jobs', function () { | |||
130 | } | 131 | } |
131 | }) | 132 | }) |
132 | 133 | ||
133 | after(function () { | 134 | after(async function () { |
134 | killallServers(servers) | 135 | await cleanupTests(servers) |
135 | }) | 136 | }) |
136 | }) | 137 | }) |
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 61c310bc3..1c0e10066 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts | |||
@@ -4,6 +4,7 @@ import 'mocha' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { VideoDetails } from '../../../shared/models/videos' | 5 | import { VideoDetails } from '../../../shared/models/videos' |
6 | import { | 6 | import { |
7 | cleanupTests, | ||
7 | doubleFollow, | 8 | doubleFollow, |
8 | execCLI, | 9 | execCLI, |
9 | flushAndRunMultipleServers, | 10 | flushAndRunMultipleServers, |
@@ -124,7 +125,7 @@ describe('Test create transcoding jobs', function () { | |||
124 | } | 125 | } |
125 | }) | 126 | }) |
126 | 127 | ||
127 | after(function () { | 128 | after(async function () { |
128 | killallServers(servers) | 129 | await cleanupTests(servers) |
129 | }) | 130 | }) |
130 | }) | 131 | }) |
diff --git a/server/tests/cli/optimize-old-videos.ts b/server/tests/cli/optimize-old-videos.ts index 14625f8c0..5e12c0089 100644 --- a/server/tests/cli/optimize-old-videos.ts +++ b/server/tests/cli/optimize-old-videos.ts | |||
@@ -4,6 +4,7 @@ import 'mocha' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { getMaxBitrate, Video, VideoDetails, VideoResolution } from '../../../shared/models/videos' | 5 | import { getMaxBitrate, Video, VideoDetails, VideoResolution } from '../../../shared/models/videos' |
6 | import { | 6 | import { |
7 | cleanupTests, | ||
7 | doubleFollow, | 8 | doubleFollow, |
8 | execCLI, | 9 | execCLI, |
9 | flushAndRunMultipleServers, | 10 | flushAndRunMultipleServers, |
@@ -112,7 +113,7 @@ describe('Test optimize old videos', function () { | |||
112 | } | 113 | } |
113 | }) | 114 | }) |
114 | 115 | ||
115 | after(function () { | 116 | after(async function () { |
116 | killallServers(servers) | 117 | await cleanupTests(servers) |
117 | }) | 118 | }) |
118 | }) | 119 | }) |
diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts index 0c11945e0..80bbc98d5 100644 --- a/server/tests/cli/peertube.ts +++ b/server/tests/cli/peertube.ts | |||
@@ -10,7 +10,7 @@ import { | |||
10 | killallServers, | 10 | killallServers, |
11 | flushAndRunServer, | 11 | flushAndRunServer, |
12 | ServerInfo, | 12 | ServerInfo, |
13 | setAccessTokensToServers | 13 | setAccessTokensToServers, cleanupTests |
14 | } from '../../../shared/extra-utils' | 14 | } from '../../../shared/extra-utils' |
15 | 15 | ||
16 | describe('Test CLI wrapper', function () { | 16 | describe('Test CLI wrapper', function () { |
@@ -46,6 +46,6 @@ describe('Test CLI wrapper', function () { | |||
46 | 46 | ||
47 | await execCLI(cmd + ` auth del ${server.url}`) | 47 | await execCLI(cmd + ` auth del ${server.url}`) |
48 | 48 | ||
49 | killallServers([ server ]) | 49 | await cleanupTests([ server ]) |
50 | }) | 50 | }) |
51 | }) | 51 | }) |
diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.ts index 1d6423814..6abb6738f 100644 --- a/server/tests/cli/reset-password.ts +++ b/server/tests/cli/reset-password.ts | |||
@@ -1,13 +1,12 @@ | |||
1 | import 'mocha' | 1 | import 'mocha' |
2 | 2 | ||
3 | import { | 3 | import { |
4 | cleanupTests, | ||
4 | createUser, | 5 | createUser, |
5 | execCLI, | 6 | execCLI, |
6 | flushTests, | 7 | flushAndRunServer, |
7 | getEnvCli, | 8 | getEnvCli, |
8 | killallServers, | ||
9 | login, | 9 | login, |
10 | flushAndRunServer, | ||
11 | ServerInfo, | 10 | ServerInfo, |
12 | setAccessTokensToServers | 11 | setAccessTokensToServers |
13 | } from '../../../shared/extra-utils' | 12 | } from '../../../shared/extra-utils' |
@@ -32,7 +31,7 @@ describe('Test reset password scripts', function () { | |||
32 | await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, 200) | 31 | await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, 200) |
33 | }) | 32 | }) |
34 | 33 | ||
35 | after(function () { | 34 | after(async function () { |
36 | killallServers([ server ]) | 35 | await cleanupTests([ server ]) |
37 | }) | 36 | }) |
38 | }) | 37 | }) |
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts index dd594779b..55c43b32f 100644 --- a/server/tests/cli/update-host.ts +++ b/server/tests/cli/update-host.ts | |||
@@ -7,17 +7,17 @@ import { waitJobs } from '../../../shared/extra-utils/server/jobs' | |||
7 | import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments' | 7 | import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments' |
8 | import { | 8 | import { |
9 | addVideoChannel, | 9 | addVideoChannel, |
10 | cleanupTests, | ||
10 | createUser, | 11 | createUser, |
11 | execCLI, | 12 | execCLI, |
12 | flushTests, | 13 | flushAndRunServer, |
13 | getEnvCli, | 14 | getEnvCli, |
14 | getVideo, | 15 | getVideo, |
15 | getVideoChannelsList, | 16 | getVideoChannelsList, |
16 | getVideosList, | 17 | getVideosList, |
17 | killallServers, | 18 | killallServers, |
18 | makeActivityPubGetRequest, | 19 | makeActivityPubGetRequest, |
19 | parseTorrentVideo, | 20 | parseTorrentVideo, reRunServer, |
20 | flushAndRunServer, | ||
21 | ServerInfo, | 21 | ServerInfo, |
22 | setAccessTokensToServers, | 22 | setAccessTokensToServers, |
23 | uploadVideo | 23 | uploadVideo |
@@ -70,7 +70,7 @@ describe('Test update host scripts', function () { | |||
70 | 70 | ||
71 | killallServers([ server ]) | 71 | killallServers([ server ]) |
72 | // Run server with standard configuration | 72 | // Run server with standard configuration |
73 | server = await flushAndRunServer(2) | 73 | await reRunServer(server) |
74 | 74 | ||
75 | const env = getEnvCli(server) | 75 | const env = getEnvCli(server) |
76 | await execCLI(`${env} npm run update-host`) | 76 | await execCLI(`${env} npm run update-host`) |
@@ -146,7 +146,7 @@ describe('Test update host scripts', function () { | |||
146 | } | 146 | } |
147 | }) | 147 | }) |
148 | 148 | ||
149 | after(function () { | 149 | after(async function () { |
150 | killallServers([ server ]) | 150 | await cleanupTests([ server ]) |
151 | }) | 151 | }) |
152 | }) | 152 | }) |