Fix Holesail client connect via Bare main HTTP control
CI / test (push) Successful in 9m58s

pear-run worker RPC timed out from the Electron UI. Run real holesail
in Bare index.js (holesailBareControl) and have the UI call localhost
HTTP instead of loading bare-tcp in the renderer.
This commit is contained in:
2026-07-10 23:19:31 -04:00
parent cc6df798e1
commit 5fbece2bd9
6 changed files with 461 additions and 158 deletions
+34
View File
@@ -0,0 +1,34 @@
import test from 'brittle'
import { createRequire } from 'module'
import os from 'os'
import path from 'path'
import fs from 'fs'
const require = createRequire(import.meta.url)
const { start } = require('../client/holesailBareControl.cjs')
test('holesail Bare control HTTP health + auth', async (t) => {
const statePath = path.join(os.tmpdir(), `pd-hs-${Date.now()}.json`)
const ctl = await start({ statePath })
t.ok(ctl.baseUrl)
t.ok(fs.existsSync(statePath))
const health = await fetch(`${ctl.baseUrl}/health`)
t.is(health.status, 200)
const hj = await health.json()
t.is(hj.service, 'holesail-local')
const unauth = await fetch(`${ctl.baseUrl}/list`)
t.is(unauth.status, 401)
const list = await fetch(`${ctl.baseUrl}/list`, {
headers: { 'X-Peardock-Token': ctl.token },
})
t.is(list.status, 200)
const lj = await list.json()
t.ok(lj.ok)
t.alike(lj.result, [])
await ctl.close()
t.absent(fs.existsSync(statePath))
})