aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/multiple-servers.ts47
-rw-r--r--server/tests/api/services.ts2
-rw-r--r--server/tests/api/single-server.ts2
-rw-r--r--server/tests/api/users.ts2
-rw-r--r--server/tests/api/video-abuse.ts14
-rw-r--r--server/tests/api/video-blacklist-management.ts6
-rw-r--r--server/tests/api/video-blacklist.ts6
-rw-r--r--server/tests/api/video-channels.ts2
-rw-r--r--server/tests/api/video-description.ts10
-rw-r--r--server/tests/api/video-privacy.ts15
-rw-r--r--server/tests/api/video-transcoder.ts6
11 files changed, 54 insertions, 58 deletions
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts
index 737770992..b6a57ab6d 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/multiple-servers.ts
@@ -85,7 +85,7 @@ describe('Test multiple servers', function () {
85 } 85 }
86 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes) 86 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
87 87
88 await wait(11000) 88 await wait(5000)
89 89
90 // All servers should have this video 90 // All servers should have this video
91 for (const server of servers) { 91 for (const server of servers) {
@@ -153,7 +153,7 @@ describe('Test multiple servers', function () {
153 }) 153 })
154 154
155 it('Should upload the video on server 2 and propagate on each server', async function () { 155 it('Should upload the video on server 2 and propagate on each server', async function () {
156 this.timeout(120000) 156 this.timeout(50000)
157 157
158 const user = { 158 const user = {
159 username: 'user1', 159 username: 'user1',
@@ -174,8 +174,8 @@ describe('Test multiple servers', function () {
174 } 174 }
175 await uploadVideo(servers[1].url, userAccessToken, videoAttributes) 175 await uploadVideo(servers[1].url, userAccessToken, videoAttributes)
176 176
177 // Transcoding, so wait more than 22000 177 // Transcoding
178 await wait(60000) 178 await wait(10000)
179 179
180 // All servers should have this video 180 // All servers should have this video
181 for (const server of servers) { 181 for (const server of servers) {
@@ -282,7 +282,7 @@ describe('Test multiple servers', function () {
282 } 282 }
283 await uploadVideo(servers[2].url, servers[2].accessToken, videoAttributes2) 283 await uploadVideo(servers[2].url, servers[2].accessToken, videoAttributes2)
284 284
285 await wait(33000) 285 await wait(10000)
286 286
287 let baseMagnet = null 287 let baseMagnet = null
288 // All servers should have this video 288 // All servers should have this video
@@ -384,8 +384,7 @@ describe('Test multiple servers', function () {
384 384
385 describe('Should seed the uploaded video', function () { 385 describe('Should seed the uploaded video', function () {
386 it('Should add the file 1 by asking server 3', async function () { 386 it('Should add the file 1 by asking server 3', async function () {
387 // Yes, this could be long 387 this.timeout(10000)
388 this.timeout(200000)
389 388
390 const res = await getVideosList(servers[2].url) 389 const res = await getVideosList(servers[2].url)
391 390
@@ -403,8 +402,7 @@ describe('Test multiple servers', function () {
403 }) 402 })
404 403
405 it('Should add the file 2 by asking server 1', async function () { 404 it('Should add the file 2 by asking server 1', async function () {
406 // Yes, this could be long 405 this.timeout(10000)
407 this.timeout(200000)
408 406
409 const res = await getVideosList(servers[0].url) 407 const res = await getVideosList(servers[0].url)
410 408
@@ -419,8 +417,7 @@ describe('Test multiple servers', function () {
419 }) 417 })
420 418
421 it('Should add the file 3 by asking server 2', async function () { 419 it('Should add the file 3 by asking server 2', async function () {
422 // Yes, this could be long 420 this.timeout(10000)
423 this.timeout(200000)
424 421
425 const res = await getVideosList(servers[1].url) 422 const res = await getVideosList(servers[1].url)
426 423
@@ -435,8 +432,7 @@ describe('Test multiple servers', function () {
435 }) 432 })
436 433
437 it('Should add the file 3-2 by asking server 1', async function () { 434 it('Should add the file 3-2 by asking server 1', async function () {
438 // Yes, this could be long 435 this.timeout(10000)
439 this.timeout(200000)
440 436
441 const res = await getVideosList(servers[0].url) 437 const res = await getVideosList(servers[0].url)
442 438
@@ -451,8 +447,7 @@ describe('Test multiple servers', function () {
451 }) 447 })
452 448
453 it('Should add the file 2 in 360p by asking server 1', async function () { 449 it('Should add the file 2 in 360p by asking server 1', async function () {
454 // Yes, this could be long 450 this.timeout(10000)
455 this.timeout(200000)
456 451
457 const res = await getVideosList(servers[0].url) 452 const res = await getVideosList(servers[0].url)
458 453
@@ -489,7 +484,7 @@ describe('Test multiple servers', function () {
489 }) 484 })
490 485
491 it('Should view multiple videos on owned servers', async function () { 486 it('Should view multiple videos on owned servers', async function () {
492 this.timeout(30000) 487 this.timeout(10000)
493 488
494 const tasks: Promise<any>[] = [] 489 const tasks: Promise<any>[] = []
495 tasks.push(getVideo(servers[2].url, localVideosServer3[0])) 490 tasks.push(getVideo(servers[2].url, localVideosServer3[0]))
@@ -499,7 +494,7 @@ describe('Test multiple servers', function () {
499 494
500 await Promise.all(tasks) 495 await Promise.all(tasks)
501 496
502 await wait(22000) 497 await wait(5000)
503 498
504 for (const server of servers) { 499 for (const server of servers) {
505 const res = await getVideosList(server.url) 500 const res = await getVideosList(server.url)
@@ -514,7 +509,7 @@ describe('Test multiple servers', function () {
514 }) 509 })
515 510
516 it('Should view multiple videos on each servers', async function () { 511 it('Should view multiple videos on each servers', async function () {
517 this.timeout(30000) 512 this.timeout(15000)
518 513
519 const tasks: Promise<any>[] = [] 514 const tasks: Promise<any>[] = []
520 tasks.push(getVideo(servers[0].url, remoteVideosServer1[0])) 515 tasks.push(getVideo(servers[0].url, remoteVideosServer1[0]))
@@ -530,7 +525,7 @@ describe('Test multiple servers', function () {
530 525
531 await Promise.all(tasks) 526 await Promise.all(tasks)
532 527
533 await wait(22000) 528 await wait(10000)
534 529
535 let baseVideos = null 530 let baseVideos = null
536 531
@@ -553,7 +548,7 @@ describe('Test multiple servers', function () {
553 }) 548 })
554 549
555 it('Should like and dislikes videos on different services', async function () { 550 it('Should like and dislikes videos on different services', async function () {
556 this.timeout(30000) 551 this.timeout(20000)
557 552
558 const tasks: Promise<any>[] = [] 553 const tasks: Promise<any>[] = []
559 tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like')) 554 tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like'))
@@ -566,7 +561,7 @@ describe('Test multiple servers', function () {
566 561
567 await Promise.all(tasks) 562 await Promise.all(tasks)
568 563
569 await wait(22000) 564 await wait(10000)
570 565
571 let baseVideos = null 566 let baseVideos = null
572 for (const server of servers) { 567 for (const server of servers) {
@@ -591,7 +586,7 @@ describe('Test multiple servers', function () {
591 586
592 describe('Should manipulate these videos', function () { 587 describe('Should manipulate these videos', function () {
593 it('Should update the video 3 by asking server 3', async function () { 588 it('Should update the video 3 by asking server 3', async function () {
594 this.timeout(15000) 589 this.timeout(10000)
595 590
596 const attributes = { 591 const attributes = {
597 name: 'my super video updated', 592 name: 'my super video updated',
@@ -605,11 +600,11 @@ describe('Test multiple servers', function () {
605 600
606 await updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, attributes) 601 await updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, attributes)
607 602
608 await wait(11000) 603 await wait(5000)
609 }) 604 })
610 605
611 it('Should have the video 3 updated on each server', async function () { 606 it('Should have the video 3 updated on each server', async function () {
612 this.timeout(200000) 607 this.timeout(10000)
613 608
614 for (const server of servers) { 609 for (const server of servers) {
615 const res = await getVideosList(server.url) 610 const res = await getVideosList(server.url)
@@ -651,12 +646,12 @@ describe('Test multiple servers', function () {
651 }) 646 })
652 647
653 it('Should remove the videos 3 and 3-2 by asking server 3', async function () { 648 it('Should remove the videos 3 and 3-2 by asking server 3', async function () {
654 this.timeout(15000) 649 this.timeout(10000)
655 650
656 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[0].id) 651 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[0].id)
657 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[1].id) 652 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[1].id)
658 653
659 await wait(11000) 654 await wait(5000)
660 }) 655 })
661 656
662 it('Should have videos 1 and 3 on each server', async function () { 657 it('Should have videos 1 and 3 on each server', async function () {
diff --git a/server/tests/api/services.ts b/server/tests/api/services.ts
index 3e6506de4..8d96ccc5e 100644
--- a/server/tests/api/services.ts
+++ b/server/tests/api/services.ts
@@ -19,7 +19,7 @@ describe('Test services', function () {
19 let server: ServerInfo = null 19 let server: ServerInfo = null
20 20
21 before(async function () { 21 before(async function () {
22 this.timeout(120000) 22 this.timeout(10000)
23 23
24 await flushTests() 24 await flushTests()
25 25
diff --git a/server/tests/api/single-server.ts b/server/tests/api/single-server.ts
index 82ecc68ee..11080085d 100644
--- a/server/tests/api/single-server.ts
+++ b/server/tests/api/single-server.ts
@@ -41,7 +41,7 @@ describe('Test a single server', function () {
41 let videosListBase: any[] = null 41 let videosListBase: any[] = null
42 42
43 before(async function () { 43 before(async function () {
44 this.timeout(120000) 44 this.timeout(10000)
45 45
46 await flushTests() 46 await flushTests()
47 47
diff --git a/server/tests/api/users.ts b/server/tests/api/users.ts
index 055dade04..5c0531571 100644
--- a/server/tests/api/users.ts
+++ b/server/tests/api/users.ts
@@ -39,7 +39,7 @@ describe('Test users', function () {
39 let userId: number 39 let userId: number
40 40
41 before(async function () { 41 before(async function () {
42 this.timeout(120000) 42 this.timeout(10000)
43 43
44 await flushTests() 44 await flushTests()
45 server = await runServer(1) 45 server = await runServer(1)
diff --git a/server/tests/api/video-abuse.ts b/server/tests/api/video-abuse.ts
index bc21ee59b..60bee9c3d 100644
--- a/server/tests/api/video-abuse.ts
+++ b/server/tests/api/video-abuse.ts
@@ -22,7 +22,7 @@ describe('Test video abuses', function () {
22 let servers: ServerInfo[] = [] 22 let servers: ServerInfo[] = []
23 23
24 before(async function () { 24 before(async function () {
25 this.timeout(100000) 25 this.timeout(50000)
26 26
27 // Run servers 27 // Run servers
28 servers = await flushAndRunMultipleServers(2) 28 servers = await flushAndRunMultipleServers(2)
@@ -46,8 +46,8 @@ describe('Test video abuses', function () {
46 } 46 }
47 await uploadVideo(servers[1].url, servers[1].accessToken, video2Attributes) 47 await uploadVideo(servers[1].url, servers[1].accessToken, video2Attributes)
48 48
49 // Wait videos propagation 49 // Wait videos propagation, server 2 has transcoding enabled
50 await wait(25000) 50 await wait(10000)
51 51
52 const res = await getVideosList(servers[0].url) 52 const res = await getVideosList(servers[0].url)
53 const videos = res.body.data 53 const videos = res.body.data
@@ -67,13 +67,13 @@ describe('Test video abuses', function () {
67 }) 67 })
68 68
69 it('Should report abuse on a local video', async function () { 69 it('Should report abuse on a local video', async function () {
70 this.timeout(15000) 70 this.timeout(10000)
71 71
72 const reason = 'my super bad reason' 72 const reason = 'my super bad reason'
73 await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[0].video.id, reason) 73 await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[0].video.id, reason)
74 74
75 // We wait requests propagation, even if the server 1 is not supposed to make a request to server 2 75 // We wait requests propagation, even if the server 1 is not supposed to make a request to server 2
76 await wait(11000) 76 await wait(5000)
77 }) 77 })
78 78
79 it('Should have 1 video abuses on server 1 and 0 on server 2', async function () { 79 it('Should have 1 video abuses on server 1 and 0 on server 2', async function () {
@@ -96,13 +96,13 @@ describe('Test video abuses', function () {
96 }) 96 })
97 97
98 it('Should report abuse on a remote video', async function () { 98 it('Should report abuse on a remote video', async function () {
99 this.timeout(25000) 99 this.timeout(10000)
100 100
101 const reason = 'my super bad reason 2' 101 const reason = 'my super bad reason 2'
102 await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[1].video.id, reason) 102 await reportVideoAbuse(servers[0].url, servers[0].accessToken, servers[1].video.id, reason)
103 103
104 // We wait requests propagation 104 // We wait requests propagation
105 await wait(15000) 105 await wait(5000)
106 }) 106 })
107 107
108 it('Should have 2 video abuse on server 1 and 1 on server 2', async function () { 108 it('Should have 2 video abuse on server 1 and 1 on server 2', async function () {
diff --git a/server/tests/api/video-blacklist-management.ts b/server/tests/api/video-blacklist-management.ts
index 718789318..0c636e094 100644
--- a/server/tests/api/video-blacklist-management.ts
+++ b/server/tests/api/video-blacklist-management.ts
@@ -35,7 +35,7 @@ describe('Test video blacklist management', function () {
35 } 35 }
36 36
37 before(async function () { 37 before(async function () {
38 this.timeout(120000) 38 this.timeout(50000)
39 39
40 // Run servers 40 // Run servers
41 servers = await flushAndRunMultipleServers(2) 41 servers = await flushAndRunMultipleServers(2)
@@ -50,8 +50,8 @@ describe('Test video blacklist management', function () {
50 await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 1st video', description: 'A video on server 2' }) 50 await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 1st video', description: 'A video on server 2' })
51 await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 2nd video', description: 'A video on server 2' }) 51 await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'My 2nd video', description: 'A video on server 2' })
52 52
53 // Wait videos propagation 53 // Wait videos propagation, server 2 has transcoding enabled
54 await wait(50000) 54 await wait(15000)
55 55
56 // Blacklist the two videos on server 1 56 // Blacklist the two videos on server 1
57 await blacklistVideosOnServer(servers[0]) 57 await blacklistVideosOnServer(servers[0])
diff --git a/server/tests/api/video-blacklist.ts b/server/tests/api/video-blacklist.ts
index 235fdd7af..3afd8c510 100644
--- a/server/tests/api/video-blacklist.ts
+++ b/server/tests/api/video-blacklist.ts
@@ -22,7 +22,7 @@ describe('Test video blacklists', function () {
22 let servers: ServerInfo[] = [] 22 let servers: ServerInfo[] = []
23 23
24 before(async function () { 24 before(async function () {
25 this.timeout(120000) 25 this.timeout(50000)
26 26
27 // Run servers 27 // Run servers
28 servers = await flushAndRunMultipleServers(2) 28 servers = await flushAndRunMultipleServers(2)
@@ -40,8 +40,8 @@ describe('Test video blacklists', function () {
40 } 40 }
41 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) 41 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
42 42
43 // Wait videos propagation 43 // Wait videos propagation, server 2 has transcoding enabled
44 await wait(25000) 44 await wait(10000)
45 45
46 const res = await getVideosList(servers[0].url) 46 const res = await getVideosList(servers[0].url)
47 const videos = res.body.data 47 const videos = res.body.data
diff --git a/server/tests/api/video-channels.ts b/server/tests/api/video-channels.ts
index de1807ef2..2d8efb320 100644
--- a/server/tests/api/video-channels.ts
+++ b/server/tests/api/video-channels.ts
@@ -26,7 +26,7 @@ describe('Test a video channels', function () {
26 let videoChannelId: number 26 let videoChannelId: number
27 27
28 before(async function () { 28 before(async function () {
29 this.timeout(120000) 29 this.timeout(10000)
30 30
31 await flushTests() 31 await flushTests()
32 32
diff --git a/server/tests/api/video-description.ts b/server/tests/api/video-description.ts
index 187fd21f2..7ad1c63ae 100644
--- a/server/tests/api/video-description.ts
+++ b/server/tests/api/video-description.ts
@@ -26,7 +26,7 @@ describe('Test video description', function () {
26 let longDescription = 'my super description for server 1'.repeat(50) 26 let longDescription = 'my super description for server 1'.repeat(50)
27 27
28 before(async function () { 28 before(async function () {
29 this.timeout(30000) 29 this.timeout(40000)
30 30
31 // Run servers 31 // Run servers
32 servers = await flushAndRunMultipleServers(2) 32 servers = await flushAndRunMultipleServers(2)
@@ -39,14 +39,14 @@ describe('Test video description', function () {
39 }) 39 })
40 40
41 it('Should upload video with long description', async function () { 41 it('Should upload video with long description', async function () {
42 this.timeout(30000) 42 this.timeout(10000)
43 43
44 const attributes = { 44 const attributes = {
45 description: longDescription 45 description: longDescription
46 } 46 }
47 await uploadVideo(servers[0].url, servers[0].accessToken, attributes) 47 await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
48 48
49 await wait(25000) 49 await wait(5000)
50 50
51 const res = await getVideosList(servers[0].url) 51 const res = await getVideosList(servers[0].url)
52 52
@@ -78,14 +78,14 @@ describe('Test video description', function () {
78 }) 78 })
79 79
80 it('Should update with a short description', async function () { 80 it('Should update with a short description', async function () {
81 this.timeout(30000) 81 this.timeout(10000)
82 82
83 const attributes = { 83 const attributes = {
84 description: 'short description' 84 description: 'short description'
85 } 85 }
86 await updateVideo(servers[0].url, servers[0].accessToken, videoId, attributes) 86 await updateVideo(servers[0].url, servers[0].accessToken, videoId, attributes)
87 87
88 await wait(25000) 88 await wait(5000)
89 }) 89 })
90 90
91 it('Should have a small description on each server', async function () { 91 it('Should have a small description on each server', async function () {
diff --git a/server/tests/api/video-privacy.ts b/server/tests/api/video-privacy.ts
index bf91ead2e..26847efce 100644
--- a/server/tests/api/video-privacy.ts
+++ b/server/tests/api/video-privacy.ts
@@ -27,7 +27,7 @@ describe('Test video privacy', function () {
27 let unlistedVideoUUID 27 let unlistedVideoUUID
28 28
29 before(async function () { 29 before(async function () {
30 this.timeout(120000) 30 this.timeout(50000)
31 31
32 // Run servers 32 // Run servers
33 servers = await flushAndRunMultipleServers(2) 33 servers = await flushAndRunMultipleServers(2)
@@ -40,14 +40,14 @@ describe('Test video privacy', function () {
40 }) 40 })
41 41
42 it('Should upload a private video on server 1', async function () { 42 it('Should upload a private video on server 1', async function () {
43 this.timeout(25000) 43 this.timeout(10000)
44 44
45 const attributes = { 45 const attributes = {
46 privacy: VideoPrivacy.PRIVATE 46 privacy: VideoPrivacy.PRIVATE
47 } 47 }
48 await uploadVideo(servers[0].url, servers[0].accessToken, attributes) 48 await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
49 49
50 await wait(15000) 50 await wait(5000)
51 }) 51 })
52 52
53 it('Should not have this private video on server 2', async function () { 53 it('Should not have this private video on server 2', async function () {
@@ -87,7 +87,7 @@ describe('Test video privacy', function () {
87 }) 87 })
88 88
89 it('Should upload an unlisted video on server 2', async function () { 89 it('Should upload an unlisted video on server 2', async function () {
90 this.timeout(50000) 90 this.timeout(30000)
91 91
92 const attributes = { 92 const attributes = {
93 name: 'unlisted video', 93 name: 'unlisted video',
@@ -95,7 +95,8 @@ describe('Test video privacy', function () {
95 } 95 }
96 await uploadVideo(servers[1].url, servers[1].accessToken, attributes) 96 await uploadVideo(servers[1].url, servers[1].accessToken, attributes)
97 97
98 await wait(40000) 98 // Server 2 has transcoding enabled
99 await wait(10000)
99 }) 100 })
100 101
101 it('Should not have this unlisted video listed on server 1 and 2', async function () { 102 it('Should not have this unlisted video listed on server 1 and 2', async function () {
@@ -125,7 +126,7 @@ describe('Test video privacy', function () {
125 }) 126 })
126 127
127 it('Should update the private video to public on server 1', async function () { 128 it('Should update the private video to public on server 1', async function () {
128 this.timeout(40000) 129 this.timeout(10000)
129 130
130 const attribute = { 131 const attribute = {
131 name: 'super video public', 132 name: 'super video public',
@@ -134,7 +135,7 @@ describe('Test video privacy', function () {
134 135
135 await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute) 136 await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute)
136 137
137 await wait(30000) 138 await wait(5000)
138 }) 139 })
139 140
140 it('Should have this new public video listed on server 1 and 2', async function () { 141 it('Should have this new public video listed on server 1 and 2', async function () {
diff --git a/server/tests/api/video-transcoder.ts b/server/tests/api/video-transcoder.ts
index e80b099d1..95d48342f 100644
--- a/server/tests/api/video-transcoder.ts
+++ b/server/tests/api/video-transcoder.ts
@@ -21,7 +21,7 @@ describe('Test video transcoding', function () {
21 let servers: ServerInfo[] = [] 21 let servers: ServerInfo[] = []
22 22
23 before(async function () { 23 before(async function () {
24 this.timeout(60000) 24 this.timeout(10000)
25 25
26 // Run servers 26 // Run servers
27 servers = await flushAndRunMultipleServers(2) 27 servers = await flushAndRunMultipleServers(2)
@@ -39,7 +39,7 @@ describe('Test video transcoding', function () {
39 } 39 }
40 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes) 40 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
41 41
42 await wait(30000) 42 await wait(10000)
43 43
44 const res = await getVideosList(servers[0].url) 44 const res = await getVideosList(servers[0].url)
45 const video = res.body.data[0] 45 const video = res.body.data[0]
@@ -67,7 +67,7 @@ describe('Test video transcoding', function () {
67 } 67 }
68 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) 68 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
69 69
70 await wait(30000) 70 await wait(10000)
71 71
72 const res = await getVideosList(servers[1].url) 72 const res = await getVideosList(servers[1].url)
73 73