docs: document infra process helpers

This commit is contained in:
Peter Steinberger
2026-06-04 03:03:13 -04:00
parent d819ef3e32
commit dc3f2bd1d9
24 changed files with 24 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Tests native approval target key generation.
import { describe, expect, it } from "vitest";
import { buildChannelApprovalNativeTargetKey } from "./approval-native-target-key.js";

View File

@@ -1,3 +1,4 @@
// Tests bundled binary discovery and version command helpers.
import { describe, expect, it, vi } from "vitest";
import type { runExec } from "../process/exec.js";
import type { RuntimeEnv } from "../runtime.js";

View File

@@ -1,3 +1,4 @@
// Tests path boundary enforcement for safe file access.
import fs from "node:fs/promises";
import path from "node:path";
import { describe, expect, it } from "vitest";

View File

@@ -1,3 +1,4 @@
// Tests build stamp file parsing and fallback behavior.
import fs from "node:fs/promises";
import { describe, expect, it } from "vitest";
import { writeBuildStamp } from "../../scripts/build-stamp.mjs";

View File

@@ -1,3 +1,4 @@
// Reads and writes clipboard text through platform command helpers.
import { runCommandWithTimeout } from "../process/exec.js";
import { isWSL2Sync } from "./wsl.js";

View File

@@ -1,3 +1,4 @@
// Tests execution approval reply text and decision formatting.
import { describe, expect, it, vi } from "vitest";
import type { ReplyPayload } from "../auto-reply/types.js";

View File

@@ -1,3 +1,4 @@
// Resolves executable paths from PATH and platform-specific install locations.
import fs from "node:fs";
import path from "node:path";
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";

View File

@@ -1,3 +1,4 @@
// Tests heartbeat event emission and listener cleanup.
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
emitHeartbeatEvent,

View File

@@ -1,3 +1,4 @@
// Tests heartbeat reason formatting and normalization.
import { describe, expect, it } from "vitest";
import { normalizeHeartbeatWakeReason } from "./heartbeat-reason.js";

View File

@@ -1,3 +1,4 @@
// Shared heartbeat runner fixtures for infra tests.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Filters host environment variables before passing them to runtimes.
import { sortUniqueStrings } from "@openclaw/normalization-core/string-normalization";
import { HOST_ENV_SECURITY_POLICY } from "./host-env-security-policy.js";
import { markOpenClawExecEnv } from "./openclaw-exec-env.js";

View File

@@ -1,3 +1,4 @@
// Tests install mode option parsing for setup commands.
import { describe, expect, it } from "vitest";
import {
resolveInstallModeOptions,

View File

@@ -1,3 +1,4 @@
// Tests module main-entry detection helpers.
import { describe, expect, it, vi } from "vitest";
import { isMainModule } from "./is-main.js";

View File

@@ -1,3 +1,4 @@
// Tests npm registry spec parsing for packages, tags, and versions.
import { describe, expect, it } from "vitest";
import {
compareOpenClawReleaseVersions,

View File

@@ -1,3 +1,4 @@
// Tests package tag parsing and stable release tag behavior.
import { describe, expect, it } from "vitest";
import { normalizePackageTagInput } from "./package-tag.js";

View File

@@ -1,3 +1,4 @@
// Tests Gemini provider usage fetch normalization.
import { describe, expect, it } from "vitest";
import { createProviderUsageFetch, makeResponse } from "../test-utils/provider-usage-fetch.js";
import { fetchGeminiUsage } from "./provider-usage.fetch.gemini.js";

View File

@@ -1,3 +1,4 @@
// Tests provider usage aggregation and formatting.
import { beforeEach, describe, expect, it } from "vitest";
import { createProviderUsageFetch } from "../test-utils/provider-usage-fetch.js";
import {

View File

@@ -1,3 +1,4 @@
// Stores and verifies web push subscriptions and delivery payloads.
import { createHash, randomUUID } from "node:crypto";
import path from "node:path";
import { resolveStateDir } from "../config/paths.js";

View File

@@ -1,3 +1,4 @@
// Coordinates restart requests around active embedded agent runs.
import { getActiveEmbeddedRunCount } from "../agents/embedded-agent-runner/run-state.js";
import { getTotalPendingReplies } from "../auto-reply/reply/dispatcher-registry.js";
import { getTotalQueueSize } from "../process/command-queue.js";

View File

@@ -1,3 +1,4 @@
// Test helper for reading SQLite pragma state.
import type { DatabaseSync } from "node:sqlite";
// SQLite pragma test helpers normalize node:sqlite bigint/number outputs.

View File

@@ -1,3 +1,4 @@
// Tests SSH config parsing and spawned command options.
import { spawn, type ChildProcess, type SpawnOptions } from "node:child_process";
import { EventEmitter } from "node:events";
import { beforeAll, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Tests system-run approval context construction.
import { describe, expect, test } from "vitest";
import {
parsePreparedSystemRunPayload,

View File

@@ -1,3 +1,4 @@
// Tests fatal unhandled rejection detection in process bootstrap.
import process from "node:process";
import { describe, it, expect, vi, beforeAll, afterAll, beforeEach, afterEach } from "vitest";

View File

@@ -1,3 +1,4 @@
// Tests watched node process restart and hashing behavior.
import { createHash } from "node:crypto";
import { EventEmitter } from "node:events";
import fs from "node:fs";