docs: document gateway session test suites

This commit is contained in:
Peter Steinberger
2026-06-04 18:10:05 -04:00
parent d89d352971
commit f0cb1a93e5
12 changed files with 24 additions and 0 deletions
+2
View File
@@ -1,3 +1,5 @@
// Session kill HTTP tests cover subagent kill authorization, requester/admin
// scope handling, local request checks, and error responses.
import { createServer } from "node:http";
import type { AddressInfo } from "node:net";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
@@ -1,3 +1,5 @@
// Transcript archive event tests ensure file archive/delete operations emit
// path-only transcript update notifications for UI and index listeners.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
@@ -1,3 +1,5 @@
// Transcript key tests cover cached lookup from transcript files back to gateway
// session keys using combined session stores and transcript candidates.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { SessionEntry } from "../config/sessions/types.js";
+2
View File
@@ -1,3 +1,5 @@
// Session filesystem utility tests cover transcript reading, usage extraction,
// preview rows, message counts, title fields, and archive candidate resolution.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
+2
View File
@@ -1,3 +1,5 @@
// Session utility performance tests protect resolver cache scaling for large
// session lists with repeated provider/model tuples.
import path from "node:path";
import { describe, test, expect, vi } from "vitest";
import * as thinking from "../auto-reply/thinking.js";
+2
View File
@@ -1,3 +1,5 @@
// Session search tests cover gateway session rows, transcript usage summaries,
// subagent state, model context limits, and cost/token display metadata.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
+2
View File
@@ -1,3 +1,5 @@
// Session utility tests cover key parsing, store migration, agent/default rows,
// model identity resolution, title derivation, and byte-capped row payloads.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
@@ -1,3 +1,5 @@
// Session history HTTP tests cover transcript-backed history responses,
// operator read auth, exact assistant messages, and transcript update delivery.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
+2
View File
@@ -1,3 +1,5 @@
// Session patch tests cover model/provider edits, subagent patching, provider
// aliases, model catalog validation, and rejected invalid patch payloads.
import { afterEach, describe, expect, test } from "vitest";
import { resetProviderAuthAliasMapCacheForTest } from "../agents/provider-auth-aliases.js";
import type { OpenClawConfig } from "../config/config.js";
+2
View File
@@ -1,3 +1,5 @@
// Session resolve tests cover canonical/legacy key lookup, store migration,
// agent scoping, listed-session selection, and protocol error mapping.
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ErrorCodes } from "../../packages/gateway-protocol/src/index.js";
import type { SessionEntry } from "../config/sessions/types.js";
+2
View File
@@ -1,3 +1,5 @@
// Startup auth tests cover weak-token rejection, startup auth repair, env secret
// references, and merged Tailscale gateway auth config.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import { KNOWN_WEAK_GATEWAY_TOKEN_PLACEHOLDERS } from "./known-weak-gateway-secrets.js";
@@ -1,3 +1,5 @@
// Startup control-UI origin tests cover runtime-only origin seeding for LAN
// gateway binds without mutating persisted config.
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { maybeSeedControlUiAllowedOriginsAtStartup } from "./startup-control-ui-origins.js";