Adjust test scripts for current database versions

This commit is contained in:
Jonas Lochmann
2026-03-23 01:00:00 +01:00
parent 6fefd4cf18
commit 510c61bafd
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -24,6 +24,8 @@ const { spawnAsync } = require('../process.js')
const { sleep } = require('../sleep.js')
async function startMariadb() {
const osUsername = require('os').userInfo().username
try { await mkdirAsync(tempDir) } catch (ex) {/* ignore */}
const instanceDir = resolve(tempDir, generateShortToken())
@@ -60,12 +62,12 @@ async function startMariadb() {
for (command of commands) {
console.log(command)
await spawnAsync('mysql', ['-S', socketPath, '-u', 'root', '-e', command], { stdio: 'inherit' })
await spawnAsync('mysql', ['-S', socketPath, '-u', osUsername, '-e', command], { stdio: 'inherit' })
}
return {
shutdown: () => {
spawnAsync('mysql', ['-S', socketPath, '-u', 'root', '-e', 'SHUTDOWN;'], { stdio: 'inherit' }).catch((ex) => {
spawnAsync('mysql', ['-S', socketPath, '-u', osUsername, '-e', 'SHUTDOWN;'], { stdio: 'inherit' }).catch((ex) => {
console.warn(ex)
})
},
+1 -1
View File
@@ -58,7 +58,7 @@ async function startPostgres() {
const password = generateToken() // this database accepts anything
await spawnAsync('createuser', ['-h', socketDir, username], { stdio: 'inherit' })
await spawnAsync('createdb', ['-h', socketDir, database], { stdio: 'inherit' })
await spawnAsync('createdb', ['-h', socketDir, '--owner', username, database], { stdio: 'inherit' })
return {
shutdown: () => task.kill('SIGINT'),