18 lines
1.0 KiB
JavaScript
18 lines
1.0 KiB
JavaScript
/** Fixed local delayed-approval acceptance; only the original guarded runner
|
|
* creates/removes a disposable PostgreSQL. No target or restore arguments. */
|
|
import assert from 'node:assert/strict'
|
|
import {spawn} from 'node:child_process'
|
|
import {dirname,resolve} from 'node:path'
|
|
import {fileURLToPath} from 'node:url'
|
|
assert.equal(process.argv.length,2)
|
|
const root=resolve(dirname(fileURLToPath(import.meta.url)),'../..')
|
|
const environment={...process.env,NODE_ENV:'test',MMAPP_OWN_SERVER_POLL_DELAYED_APPROVAL:'true',
|
|
MMAPP_OWN_SERVER_POLL_HTTP_ROUTE:'false',MMAPP_OWN_SERVER_POLL_SETTINGS_EPOCH:'false'}
|
|
// This fixed profile never requests the original runner's full terminal restore.
|
|
delete environment.MMAPP_PG_CLIENT_BIN
|
|
const child=spawn(process.execPath,[resolve(root,'backend/scripts/test-mcp-postgres.mjs'),'--server-poll-storage-fresh'],{
|
|
cwd:root,windowsHide:true,stdio:'inherit',env:environment,
|
|
})
|
|
const code=await new Promise((done,reject)=>{child.once('error',reject);child.once('exit',code=>done(code??1))})
|
|
process.exitCode=code
|