Tests take away the login they write into the shared config directory
ci / check (push) Canceled after 0s

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-12 19:02:08 +00:00
1 parent ff39b9dcbc
commit e0f0a6d7bf
3 files changed
+26 -5

No files matched your search

+9 -2
View File
@@ -1,8 +1,8 @@
// ACP: the JSON-RPC peer, LLeMbas CLI as an agent (serve --stdio and the LLeMbas link
// share it), the device's own limits on remote work, the link itself against a fake LLeMbas, the
// service unit, and library: lembas.
import { afterEach, expect, test } from "bun:test"
import { mkdirSync, mkdtempSync, realpathSync, writeFileSync } from "node:fs"
import { afterAll, afterEach, expect, test } from "bun:test"
import { mkdirSync, mkdtempSync, realpathSync, writeFileSync, rmSync } from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"
import { AcpAgent, clampMode, underRoots, type Limits } from "../src/acp/agent.ts"
@@ -13,6 +13,13 @@ import { setTrust } from "../src/project/root.ts"
import { unitText } from "../src/service.ts"
import { delta, fakeProvider, toolCall, type Fake } from "./fake-provider.ts"
// The whole suite shares one config directory: the login this file writes there is taken away
// again, or every later start-up says "not signed in to …" about it.
afterAll(() => {
rmSync(join(paths.config, "lembas.json"), { force: true })
rmSync(join(paths.config, "lembas"), { recursive: true, force: true })
})
let fake: Fake | undefined
const stops: (() => void)[] = []
afterEach(() => {
+8 -1
View File
@@ -2,7 +2,7 @@
// discovery document, signed in by device code, one connection named after the instance with the key
// in a 0600 file — and the models, their settings, the voice and the search read from the instance
// at every start rather than copied into the config. `logout` revokes and removes exactly that.
import { afterEach, beforeEach, expect, test } from "bun:test"
import { afterAll, afterEach, beforeEach, expect, test } from "bun:test"
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs"
import { join } from "node:path"
import { parse } from "yaml"
@@ -17,6 +17,13 @@ import { webuiFetch } from "../src/search/webui.ts"
import { wav } from "../src/voice/audio.ts"
import { synthesize, transcribe } from "../src/voice/speech.ts"
// The whole suite shares one config directory: the login this file writes there is taken away
// again, or every later start-up says "not signed in to …" about it.
afterAll(() => {
rmSync(join(paths.config, "lembas.json"), { force: true })
rmSync(join(paths.config, "lembas"), { recursive: true, force: true })
})
interface Fake {
url: string
stop(): void
+9 -2
View File
@@ -1,7 +1,7 @@
// Local mode (`lembas -l`): everything under the project, the user's login read and nothing more,
// and what would reach or be kept on a server turned off.
import { afterEach, expect, test } from "bun:test"
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs"
import { afterAll, afterEach, expect, test } from "bun:test"
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, writeFileSync, rmSync } from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"
import { addPendingDeleted, pendingDeleted } from "../src/acp/pending.ts"
@@ -16,6 +16,13 @@ import { protectedPath } from "../src/permission/hardline.ts"
import { enterLocal, LocalError } from "../src/project/local.ts"
import { delta, fakeProvider } from "./fake-provider.ts"
// The whole suite shares one config directory: the login this file writes there is taken away
// again, or every later start-up says "not signed in to …" about it.
afterAll(() => {
rmSync(join(globalPaths.config, "lembas.json"), { force: true })
rmSync(join(globalPaths.config, "lembas"), { recursive: true, force: true })
})
const cli = join(import.meta.dir, "../src/cli.ts")
const xdgData = process.env.XDG_DATA_HOME