diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 09:43:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 6c5065a011b099618681a37bd77eaa7bd3db752e (patch) | |
tree | 352252a00b25013c4b1902f6bcd9668aba295c7b /server/tests/plugins/plugin-helpers.ts | |
parent | 0d8ecb7592577f54012413a2b5a9b159cfc90399 (diff) | |
download | PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.gz PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.zst PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.zip |
Introduce server commands
Diffstat (limited to 'server/tests/plugins/plugin-helpers.ts')
-rw-r--r-- | server/tests/plugins/plugin-helpers.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts index 0e0f61638..cbb6887eb 100644 --- a/server/tests/plugins/plugin-helpers.ts +++ b/server/tests/plugins/plugin-helpers.ts | |||
@@ -17,8 +17,7 @@ import { | |||
17 | setAccessTokensToServers, | 17 | setAccessTokensToServers, |
18 | uploadVideoAndGetId, | 18 | uploadVideoAndGetId, |
19 | viewVideo, | 19 | viewVideo, |
20 | waitJobs, | 20 | waitJobs |
21 | waitUntilLog | ||
22 | } from '@shared/extra-utils' | 21 | } from '@shared/extra-utils' |
23 | 22 | ||
24 | function postCommand (server: ServerInfo, command: string, bodyArg?: object) { | 23 | function postCommand (server: ServerInfo, command: string, bodyArg?: object) { |
@@ -50,22 +49,22 @@ describe('Test plugin helpers', function () { | |||
50 | describe('Logger', function () { | 49 | describe('Logger', function () { |
51 | 50 | ||
52 | it('Should have logged things', async function () { | 51 | it('Should have logged things', async function () { |
53 | await waitUntilLog(servers[0], 'localhost:' + servers[0].port + ' peertube-plugin-test-four', 1, false) | 52 | await servers[0].serversCommand.waitUntilLog('localhost:' + servers[0].port + ' peertube-plugin-test-four', 1, false) |
54 | await waitUntilLog(servers[0], 'Hello world from plugin four', 1) | 53 | await servers[0].serversCommand.waitUntilLog('Hello world from plugin four', 1) |
55 | }) | 54 | }) |
56 | }) | 55 | }) |
57 | 56 | ||
58 | describe('Database', function () { | 57 | describe('Database', function () { |
59 | 58 | ||
60 | it('Should have made a query', async function () { | 59 | it('Should have made a query', async function () { |
61 | await waitUntilLog(servers[0], `root email is admin${servers[0].internalServerNumber}@example.com`) | 60 | await servers[0].serversCommand.waitUntilLog(`root email is admin${servers[0].internalServerNumber}@example.com`) |
62 | }) | 61 | }) |
63 | }) | 62 | }) |
64 | 63 | ||
65 | describe('Config', function () { | 64 | describe('Config', function () { |
66 | 65 | ||
67 | it('Should have the correct webserver url', async function () { | 66 | it('Should have the correct webserver url', async function () { |
68 | await waitUntilLog(servers[0], `server url is http://localhost:${servers[0].port}`) | 67 | await servers[0].serversCommand.waitUntilLog(`server url is http://localhost:${servers[0].port}`) |
69 | }) | 68 | }) |
70 | 69 | ||
71 | it('Should have the correct config', async function () { | 70 | it('Should have the correct config', async function () { |
@@ -83,7 +82,7 @@ describe('Test plugin helpers', function () { | |||
83 | describe('Server', function () { | 82 | describe('Server', function () { |
84 | 83 | ||
85 | it('Should get the server actor', async function () { | 84 | it('Should get the server actor', async function () { |
86 | await waitUntilLog(servers[0], 'server actor name is peertube') | 85 | await servers[0].serversCommand.waitUntilLog('server actor name is peertube') |
87 | }) | 86 | }) |
88 | }) | 87 | }) |
89 | 88 | ||
@@ -248,7 +247,7 @@ describe('Test plugin helpers', function () { | |||
248 | // Should delete the video | 247 | // Should delete the video |
249 | await viewVideo(servers[0].url, videoUUID) | 248 | await viewVideo(servers[0].url, videoUUID) |
250 | 249 | ||
251 | await waitUntilLog(servers[0], 'Video deleted by plugin four.') | 250 | await servers[0].serversCommand.waitUntilLog('Video deleted by plugin four.') |
252 | 251 | ||
253 | try { | 252 | try { |
254 | // Should throw because the video should have been deleted | 253 | // Should throw because the video should have been deleted |
@@ -258,11 +257,11 @@ describe('Test plugin helpers', function () { | |||
258 | if (err.message.includes('exists')) throw err | 257 | if (err.message.includes('exists')) throw err |
259 | } | 258 | } |
260 | 259 | ||
261 | await checkVideoFilesWereRemoved(videoUUID, servers[0].internalServerNumber) | 260 | await checkVideoFilesWereRemoved(videoUUID, servers[0]) |
262 | }) | 261 | }) |
263 | 262 | ||
264 | it('Should have fetched the video by URL', async function () { | 263 | it('Should have fetched the video by URL', async function () { |
265 | await waitUntilLog(servers[0], `video from DB uuid is ${videoUUID}`) | 264 | await servers[0].serversCommand.waitUntilLog(`video from DB uuid is ${videoUUID}`) |
266 | }) | 265 | }) |
267 | }) | 266 | }) |
268 | 267 | ||