aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r--shared/extra-utils/server/servers.ts18
1 files changed, 15 insertions, 3 deletions
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts
index e88482e49..fe4ed3e48 100644
--- a/shared/extra-utils/server/servers.ts
+++ b/shared/extra-utils/server/servers.ts
@@ -2,11 +2,11 @@
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { ChildProcess, exec, fork } from 'child_process' 4import { ChildProcess, exec, fork } from 'child_process'
5import { copy, pathExists, readdir, readFile, remove } from 'fs-extra' 5import { copy, ensureDir, pathExists, readdir, readFile, remove } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { randomInt } from '../../core-utils/miscs/miscs' 7import { randomInt } from '../../core-utils/miscs/miscs'
8import { VideoChannel } from '../../models/videos' 8import { VideoChannel } from '../../models/videos'
9import { buildServerDirectory, getFileSize, root, wait } from '../miscs/miscs' 9import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs'
10 10
11interface ServerInfo { 11interface ServerInfo {
12 app: ChildProcess 12 app: ChildProcess
@@ -298,11 +298,23 @@ function killallServers (servers: ServerInfo[]) {
298 } 298 }
299} 299}
300 300
301function cleanupTests (servers: ServerInfo[]) { 301async function cleanupTests (servers: ServerInfo[]) {
302 killallServers(servers) 302 killallServers(servers)
303 303
304 if (isGithubCI()) {
305 await ensureDir('artifacts')
306 }
307
304 const p: Promise<any>[] = [] 308 const p: Promise<any>[] = []
305 for (const server of servers) { 309 for (const server of servers) {
310 if (isGithubCI()) {
311 const origin = await buildServerDirectory(server, 'logs/peertube.log')
312 const destname = `peertube-${server.internalServerNumber}.log`
313 console.log('Saving logs %s.', destname)
314
315 await copy(origin, join('artifacts', destname))
316 }
317
306 if (server.parallel) { 318 if (server.parallel) {
307 p.push(flushTests(server.internalServerNumber)) 319 p.push(flushTests(server.internalServerNumber))
308 } 320 }