1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Save DB of tests too

This commit is contained in:
Chocobozzz 2025-03-18 09:23:03 +01:00
parent 408af46439
commit 772a41e9ea
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 13 additions and 2 deletions

View file

@ -8,7 +8,6 @@ import { basename, join } from 'path'
import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js'
export class ServersCommand extends AbstractCommand {
static flushTests (internalServerNumber: number) {
return new Promise<void>((res, rej) => {
const suffix = ` -- ${internalServerNumber}`
@ -46,9 +45,20 @@ export class ServersCommand extends AbstractCommand {
await copy(origin, join('artifacts', destname))
}
const saveDBIfNeeded = async () => {
if (!isGithubCI()) return
await ensureDir('artifacts')
const destname = join('databases', `peertube-${this.server.internalServerNumber}.sql`)
console.log('Saving database %s.', destname)
exec(`pg_dump peertube_test${this.server.internalServerNumber} > ${destname}`)
}
if (this.server.parallel) {
const promise = saveGithubLogsIfNeeded()
.then(() => ServersCommand.flushTests(this.server.internalServerNumber))
.then(() => saveDBIfNeeded())
.then(() => ServersCommand.flushTests(this.server.internalServerNumber))
promises.push(promise)
}

View file

@ -47,6 +47,7 @@ OPENDKIM_DOMAINS=<MY DOMAIN>=peertube
# see https://github.com/wader/postfix-relay/pull/18
OPENDKIM_RequireSafeKeys=no
# Comment these variables if your S3 provider does not support object ACL
PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PUBLIC="public-read"
PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PRIVATE="private"