aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/server/logs.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/server/logs.ts')
-rw-r--r--server/tests/api/server/logs.ts23
1 files changed, 11 insertions, 12 deletions
diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts
index 096d63e21..e7bef5a4a 100644
--- a/server/tests/api/server/logs.ts
+++ b/server/tests/api/server/logs.ts
@@ -10,7 +10,6 @@ import {
10 reRunServer, 10 reRunServer,
11 ServerInfo, 11 ServerInfo,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 uploadVideo,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16 15
@@ -34,12 +33,12 @@ describe('Test logs', function () {
34 it('Should get logs with a start date', async function () { 33 it('Should get logs with a start date', async function () {
35 this.timeout(20000) 34 this.timeout(20000)
36 35
37 await uploadVideo(server.url, server.accessToken, { name: 'video 1' }) 36 await server.videosCommand.upload({ attributes: { name: 'video 1' } })
38 await waitJobs([ server ]) 37 await waitJobs([ server ])
39 38
40 const now = new Date() 39 const now = new Date()
41 40
42 await uploadVideo(server.url, server.accessToken, { name: 'video 2' }) 41 await server.videosCommand.upload({ attributes: { name: 'video 2' } })
43 await waitJobs([ server ]) 42 await waitJobs([ server ])
44 43
45 const body = await logsCommand.getLogs({ startDate: now }) 44 const body = await logsCommand.getLogs({ startDate: now })
@@ -52,17 +51,17 @@ describe('Test logs', function () {
52 it('Should get logs with an end date', async function () { 51 it('Should get logs with an end date', async function () {
53 this.timeout(30000) 52 this.timeout(30000)
54 53
55 await uploadVideo(server.url, server.accessToken, { name: 'video 3' }) 54 await server.videosCommand.upload({ attributes: { name: 'video 3' } })
56 await waitJobs([ server ]) 55 await waitJobs([ server ])
57 56
58 const now1 = new Date() 57 const now1 = new Date()
59 58
60 await uploadVideo(server.url, server.accessToken, { name: 'video 4' }) 59 await server.videosCommand.upload({ attributes: { name: 'video 4' } })
61 await waitJobs([ server ]) 60 await waitJobs([ server ])
62 61
63 const now2 = new Date() 62 const now2 = new Date()
64 63
65 await uploadVideo(server.url, server.accessToken, { name: 'video 5' }) 64 await server.videosCommand.upload({ attributes: { name: 'video 5' } })
66 await waitJobs([ server ]) 65 await waitJobs([ server ])
67 66
68 const body = await logsCommand.getLogs({ startDate: now1, endDate: now2 }) 67 const body = await logsCommand.getLogs({ startDate: now1, endDate: now2 })
@@ -78,7 +77,7 @@ describe('Test logs', function () {
78 77
79 const now = new Date() 78 const now = new Date()
80 79
81 await uploadVideo(server.url, server.accessToken, { name: 'video 6' }) 80 await server.videosCommand.upload({ attributes: { name: 'video 6' } })
82 await waitJobs([ server ]) 81 await waitJobs([ server ])
83 82
84 { 83 {
@@ -131,12 +130,12 @@ describe('Test logs', function () {
131 it('Should get logs with a start date', async function () { 130 it('Should get logs with a start date', async function () {
132 this.timeout(20000) 131 this.timeout(20000)
133 132
134 await uploadVideo(server.url, server.accessToken, { name: 'video 7' }) 133 await server.videosCommand.upload({ attributes: { name: 'video 7' } })
135 await waitJobs([ server ]) 134 await waitJobs([ server ])
136 135
137 const now = new Date() 136 const now = new Date()
138 137
139 await uploadVideo(server.url, server.accessToken, { name: 'video 8' }) 138 await server.videosCommand.upload({ attributes: { name: 'video 8' } })
140 await waitJobs([ server ]) 139 await waitJobs([ server ])
141 140
142 const body = await logsCommand.getAuditLogs({ startDate: now }) 141 const body = await logsCommand.getAuditLogs({ startDate: now })
@@ -157,17 +156,17 @@ describe('Test logs', function () {
157 it('Should get logs with an end date', async function () { 156 it('Should get logs with an end date', async function () {
158 this.timeout(30000) 157 this.timeout(30000)
159 158
160 await uploadVideo(server.url, server.accessToken, { name: 'video 9' }) 159 await server.videosCommand.upload({ attributes: { name: 'video 9' } })
161 await waitJobs([ server ]) 160 await waitJobs([ server ])
162 161
163 const now1 = new Date() 162 const now1 = new Date()
164 163
165 await uploadVideo(server.url, server.accessToken, { name: 'video 10' }) 164 await server.videosCommand.upload({ attributes: { name: 'video 10' } })
166 await waitJobs([ server ]) 165 await waitJobs([ server ])
167 166
168 const now2 = new Date() 167 const now2 = new Date()
169 168
170 await uploadVideo(server.url, server.accessToken, { name: 'video 11' }) 169 await server.videosCommand.upload({ attributes: { name: 'video 11' } })
171 await waitJobs([ server ]) 170 await waitJobs([ server ])
172 171
173 const body = await logsCommand.getAuditLogs({ startDate: now1, endDate: now2 }) 172 const body = await logsCommand.getAuditLogs({ startDate: now1, endDate: now2 })