docs: document doctor command tests

This commit is contained in:
Peter Steinberger
2026-06-04 19:44:23 -04:00
parent 4499b24781
commit 81eee47045
50 changed files with 50 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Doctor channel capability tests cover channel capability inspection and diagnostics.
import { describe, expect, it } from "vitest";
import { getDoctorChannelCapabilities } from "./channel-capabilities.js";

View File

@@ -1,3 +1,4 @@
// Dreaming payload constant-drift tests cover cron doctor migration fixture drift.
import fs from "node:fs/promises";
import path from "node:path";
import { describe, expect, it } from "vitest";

View File

@@ -1,3 +1,4 @@
// Dreaming payload migration tests cover cron doctor repair of old dreaming payloads.
import { describe, expect, it } from "vitest";
import {
countStaleDreamingJobs,

View File

@@ -1,3 +1,4 @@
// Doctor cron index tests cover cron doctor checks and repair entrypoints.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Legacy delivery tests cover cron doctor repair of old delivery state.
import { describe, expect, it } from "vitest";
import {
buildDeliveryFromLegacyPayload,

View File

@@ -1,3 +1,4 @@
// Cron store migration tests cover doctor migration of persisted cron stores.
import { describe, expect, it } from "vitest";
import { DEFAULT_TOP_OF_HOUR_STAGGER_MS } from "../../../cron/stagger.js";
import { normalizeStoredCronJobs } from "./store-migration.js";

View File

@@ -1,3 +1,4 @@
// Doctor emit-note tests cover terminal note output and doctor issue formatting.
import { describe, expect, it, vi } from "vitest";
import { emitDoctorNotes } from "./emit-notes.js";

View File

@@ -1,3 +1,4 @@
// Doctor finalize config-flow tests cover final repair summaries and config mutation completion.
import { describe, expect, it, vi } from "vitest";
import { finalizeDoctorConfigFlow } from "./finalize-config-flow.js";

View File

@@ -1,3 +1,4 @@
// Doctor repair sequencing tests cover ordered repair execution and dependency handling.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../config/config.js";
import { runDoctorRepairSequence } from "./repair-sequencing.js";

View File

@@ -1,3 +1,4 @@
// Active tool schema warning tests cover doctor warnings for active tool schema drift.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { createOpenClawCodingTools } from "../../../agents/agent-tools.js";
import type { AnyAgentTool } from "../../../agents/tools/common.js";

View File

@@ -1,3 +1,4 @@
// Allow-from fallback migration tests cover doctor repair of legacy sender allowlists.
import { describe, expect, it, vi } from "vitest";
import { maybeRepairGroupAllowFromFallback } from "./allowfrom-fallback-migration.js";

View File

@@ -1,3 +1,4 @@
// Allowlist policy repair tests cover doctor repair of unsafe or stale allowlist policy.
import { beforeEach, describe, expect, it, vi } from "vitest";
import { maybeRepairAllowlistPolicyAllowFrom } from "./allowlist-policy-repair.js";

View File

@@ -1,3 +1,4 @@
// Allowlist tests cover doctor allowlist diagnostics and repair helpers.
import { describe, expect, it } from "vitest";
import { hasAllowFromEntries } from "./allowlist.js";

View File

@@ -1,3 +1,4 @@
// Bundled plugin load-path tests cover doctor validation of bundled plugin paths.
import path from "node:path";
import { bundledDistPluginRootAt, bundledPluginRootAt } from "openclaw/plugin-sdk/test-fixtures";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Channel doctor tests cover shared channel health checks and repair hints.
import { beforeEach, describe, expect, it, vi } from "vitest";
import {
collectChannelDoctorCompatibilityMutations,

View File

@@ -1,3 +1,4 @@
// Channel legacy config migration tests cover doctor repair of old channel config shapes.
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const { applyPluginDoctorCompatibilityMigrations, collectRelevantDoctorPluginIds } = vi.hoisted(

View File

@@ -1,3 +1,4 @@
// Channel plugin blocker tests cover doctor diagnostics for blocked channel plugin setup.
import { beforeEach, describe, expect, it, vi } from "vitest";
import * as manifestRegistry from "../../../plugins/manifest-registry.js";
import { scanConfiguredChannelPluginBlockers } from "./channel-plugin-blockers.js";

View File

@@ -1,3 +1,4 @@
// Codex native asset tests cover doctor detection of native Codex asset state.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Codex route warning tests cover doctor diagnostics for Codex route configuration.
import { beforeEach, describe, expect, it, vi } from "vitest";
import { resolveAgentHarnessPolicy } from "../../../agents/harness/policy.js";
import type { SessionEntry } from "../../../config/sessions/types.js";

View File

@@ -1,3 +1,4 @@
// Config-flow step tests cover doctor repair step ordering and mutation planning.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import type { DoctorConfigPreflightResult } from "../../doctor-config-preflight.js";

View File

@@ -1,3 +1,4 @@
// Config mutation state tests cover doctor mutation tracking and final state reporting.
import { describe, expect, it } from "vitest";
import { applyDoctorConfigMutation } from "./config-mutation-state.js";
import type { DoctorConfigMutationState } from "./config-mutation-state.js";

View File

@@ -1,3 +1,4 @@
// Context engine host compatibility tests cover doctor warnings for host/context mismatches.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
import { registerContextEngine } from "../../../context-engine/registry.js";

View File

@@ -1,3 +1,4 @@
// Deprecation compatibility tests cover doctor warnings and repairs for deprecated config.
import fs from "node:fs";
import { describe, expect, it } from "vitest";
import {

View File

@@ -1,3 +1,4 @@
// Empty allowlist policy tests cover doctor policy behavior when allowlists are empty.
import { describe, expect, it, vi } from "vitest";
import { collectEmptyAllowlistPolicyWarningsForAccount } from "./empty-allowlist-policy.js";

View File

@@ -1,3 +1,4 @@
// Empty allowlist scan tests cover doctor detection of unconfigured sender allowlists.
import { describe, expect, it, vi } from "vitest";
import { scanEmptyAllowlistPolicyWarnings } from "./empty-allowlist-scan.js";

View File

@@ -1,3 +1,4 @@
// Exec safe-bin tests cover doctor validation of executable helper paths.
import { chmodSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { delimiter, join } from "node:path";

View File

@@ -1,3 +1,4 @@
// Hooks token reuse repair tests cover doctor repairs for reused gateway hook tokens.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
import { repairHooksTokenReuseGatewayAuth } from "./hooks-token-reuse-repair.js";

View File

@@ -1,3 +1,4 @@
// Invalid plugin config tests cover doctor diagnostics for malformed plugin configuration.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../../config/types.openclaw.js";

View File

@@ -1,3 +1,4 @@
// Legacy provider-shape migration tests cover doctor repair of old provider config shapes.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/types.js";
import { LEGACY_CONFIG_MIGRATIONS_RUNTIME_TTS } from "./legacy-config-migrations.runtime.tts.js";

View File

@@ -1,3 +1,4 @@
// Legacy config migration tests cover generic doctor repair of old config layouts.
import { describe, expect, it } from "vitest";
import { findLegacyConfigIssues } from "../../../config/legacy.js";
import type { OpenClawConfig } from "../../../config/types.js";

View File

@@ -1,3 +1,4 @@
// Legacy config migration validation tests cover schema validation after doctor migrations.
import { beforeAll, describe, expect, it } from "vitest";
import { migrateLegacyConfig } from "./legacy-config-migrate.js";

View File

@@ -1,3 +1,4 @@
// Runtime model migration tests cover doctor legacy config migrations for model runtime shape.
import { describe, it, expect } from "vitest";
import { LEGACY_CONFIG_MIGRATIONS_RUNTIME_MODELS } from "./legacy-config-migrations.runtime.models.js";

View File

@@ -1,3 +1,4 @@
// Legacy config write ownership tests cover doctor ownership boundaries for migrations.
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Legacy model metadata tests cover doctor migration that adds model metadata.
import { describe, expect, it } from "vitest";
import type { ModelDefinitionConfig } from "../../../config/types.models.js";
import { isLegacyModelsAddCodexMetadataModel } from "./legacy-models-add-metadata.js";

View File

@@ -1,3 +1,4 @@
// Legacy OAuth sidecar tests cover doctor repair and warnings for old OAuth sidecar state.
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resetLogger, setLoggerOverride } from "../../../logging/logger.js";
import { loggingState } from "../../../logging/state.js";

View File

@@ -1,3 +1,4 @@
// Legacy tools-by-sender tests cover doctor migration of sender-scoped tool config.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import {

View File

@@ -1,3 +1,4 @@
// Legacy web-fetch migration tests cover doctor repair of old web fetch config.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import {

View File

@@ -1,3 +1,4 @@
// Legacy web-search migration tests cover doctor repair of old web search config.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import {

View File

@@ -1,3 +1,4 @@
// Legacy X search migration tests cover doctor repair of old X search config.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import {

View File

@@ -1,3 +1,4 @@
// Missing configured plugin install tests cover doctor diagnostics for absent plugin installs.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Open policy allow-from tests cover doctor handling of open allowlist policy.
import { describe, expect, it, vi } from "vitest";
import {
collectOpenPolicyAllowFromWarnings,

View File

@@ -1,3 +1,4 @@
// Plugin dependency cleanup tests cover doctor cleanup of stale plugin dependencies.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Plugin registry migration tests cover doctor repair of persisted plugin registry state.
import fs from "node:fs";
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Plugin tool allowlist warning tests cover doctor warnings for stale tool allowlists.
import { describe, expect, it } from "vitest";
import type { PluginManifestRegistry } from "../../../plugins/manifest-registry.js";
import { collectPluginToolAllowlistWarnings } from "./plugin-tool-allowlist-warnings.js";

View File

@@ -1,3 +1,4 @@
// Preview warning tests cover doctor warnings for preview or experimental config state.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Release configured plugin install tests cover doctor checks for release-time plugin installs.
import { beforeEach, describe, expect, it, vi } from "vitest";
const mocks = vi.hoisted(() => ({

View File

@@ -1,3 +1,4 @@
// Stale OAuth profile shadow tests cover doctor detection of shadowed auth profiles.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Stale plugin config tests cover doctor cleanup and warnings for obsolete plugin config.
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../../config/config.js";
import type { PluginInstallRecord } from "../../../config/types.plugins.js";

View File

@@ -1,3 +1,4 @@
// Stale subagent allowlist tests cover doctor warnings for obsolete subagent allowlists.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
import {

View File

@@ -1,3 +1,4 @@
// Update phase tests cover doctor behavior during staged update phases.
import { describe, expect, it } from "vitest";
import {
UPDATE_DEFER_CONFIGURED_PLUGIN_INSTALL_REPAIR_ENV,