Skip to content

test: fix changed-run routing, dedupe gateway package lanes, repair force-rerun triggers#104287

Merged
steipete merged 2 commits into
mainfrom
claude/test-setup-verification-8bc8ec
Jul 11, 2026
Merged

test: fix changed-run routing, dedupe gateway package lanes, repair force-rerun triggers#104287
steipete merged 2 commits into
mainfrom
claude/test-setup-verification-8bc8ec

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #104231

What Problem This Solves

Fixes an issue where maintainers and agents running pnpm test:changed after editing extensions/active-memory tests would get a false green: the changed-run planner routed those files to the catch-all extensions lane, which excludes them, so nothing executed. Also resolves a set of verified test-harness integrity defects from the same audit: 22 gateway package test files ran twice in the root Vitest matrix, the hand-maintained forceRerunTriggers list never matched anything (and had drifted), the shared config printed a Vitest 4.1.9 deprecation warning on every run, stalled test:live runs printed heartbeats forever without terminating, the live-docker changed-lane regex missed one of its own shell targets, and four files (two Vitest configs, two shell scripts) were orphaned with zero references.

Why This Change Was Made

A test-setup verification pass (issue #104231) confirmed each defect against source, the Vitest 4.1.9 dependency internals, and live runs. The fixes prefer deleting drift-prone hand-maintained lists over patching them: the extension routing ternary became a table with a generic drift guard, the force-rerun list is generated from the config directory, and the live-docker target list has a single owner. Net non-test LOC goes down.

Notable dependency-verified detail: Vitest matches forceRerunTriggers with picomatch against absolute changed-file paths and appends absolute setupFiles itself ([email protected] resolveConfig/handleFileChanged), so the old repo-relative entries silently never matched; entries are now resolved absolute. The explicit file enumeration is kept alongside a glob because chokidar v5 (used for watcher.add) does not support globs.

User Impact

None at product runtime — this is developer/CI test-harness behavior. test:changed proof for active-memory edits is now real, root-matrix runs stop double-executing gateway package tests, watch mode reruns when lane configs change, and stalled live runs terminate with a non-zero exit instead of hanging.

Evidence

  • Focused meta-test lanes green on remote Linux (brokered AWS Crabbox, lease cbx_3f4981493e64, c7a.8xlarge): test/vitest-projects-config.test.ts, test/package-scripts.test.ts, test/vitest-unit-paths.test.ts, test/scripts/{test-projects,run-vitest,changed-lanes,test-live,test-extension}.test.ts.
  • pnpm test:changed on the same box: 3 shards, 5588 passed, 1 failed — test/scripts/release-ci-summary.test.ts "hashes and safely streams one bounded manifest entry", which requires the unzip binary; the box has no unzip (command -v unzip → missing) and the file is untouched by this diff. The same file passes 39/39 where unzip exists.
  • pnpm check:changed (typecheck/lint/guards for affected lanes) green on the same box, exit 0.
  • Structured autoreview (codex, gpt-5.6-sol, thinking xhigh): clean, "patch is correct (0.91)", no actionable findings.
  • Blacksmith Testbox was unavailable during verification (fresh leases shut down mid-hydration, GitHub Actions runs 29143672142 / 29143737632), hence the brokered AWS fallback.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling size: L maintainer Maintainer-authored PR labels Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d82cdefe44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

};
const EXTENSION_TEST_CONFIG_ROUTES = [
[(root) => channelTestRoots.includes(root), "test/vitest/vitest.extension-channels.config.ts"],
[isActiveMemoryExtensionRoot, "test/vitest/vitest.extension-active-memory.config.ts"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make active-memory routing reachable from test-extension

This new active-memory route is not reachable through the main extension planner: resolveExtensionDirectory() only accepts targets whose directory contains package.json, while extensions/active-memory is a manifest-only plugin (openclaw.plugin.json with no package.json). As a result, pnpm test:extension active-memory still throws Unknown extension target, and batch planning via listAvailableExtensionIds() also omits it, so the new route/test only verifies the helper directly rather than the user-facing command path.

Useful? React with 👍 / 👎.

steipete added 2 commits July 11, 2026 08:48
…orce-rerun triggers

- route extensions/active-memory changed runs to their dedicated lane; add a
  generic guard that every catch-all-excluded extension root resolves to a
  dedicated config so future split lanes cannot silently skip changed tests
- exclude packages/gateway-client and packages/gateway-protocol from the unit
  lane; explicit targets now route to the gateway-client lane (was double-run)
- generate forceRerunTriggers from the test/vitest directory and resolve all
  entries absolute: Vitest matches triggers against absolute changed-file
  paths, so the old hand-maintained relative list never matched at all
- replace deprecated envFile:false with envDir:false (Vitest 4.1.9 warning)
- give scripts/test-live.mjs stall detection teeth: kill the process group and
  exit non-zero when OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS elapses quietly
- consolidate the live-docker shell target list into changed-lanes.mjs so the
  lane regex and check targets cannot drift; cover subagent-announce edits
- delete orphans: vitest.extension-clickclack.config.ts,
  vitest.full-core-unit.config.ts, scripts/test-docker-all.sh,
  scripts/test-live-acp-spawn-defaults-docker.sh

Closes #104231
…nfig

Vite 8 types envDir as string | false; the bare object literal widened false to
boolean and broke check:test-types at the defineConfig call sites.
@steipete
steipete force-pushed the claude/test-setup-verification-8bc8ec branch from d82cdef to 4ca42f5 Compare July 11, 2026 07:49
@steipete
steipete merged commit 8cd0926 into main Jul 11, 2026
82 checks passed
@steipete
steipete deleted the claude/test-setup-verification-8bc8ec branch July 11, 2026 07:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 11, 2026
…orce-rerun triggers (openclaw#104287)

* test: fix changed-run routing, dedupe gateway package lanes, repair force-rerun triggers

- route extensions/active-memory changed runs to their dedicated lane; add a
  generic guard that every catch-all-excluded extension root resolves to a
  dedicated config so future split lanes cannot silently skip changed tests
- exclude packages/gateway-client and packages/gateway-protocol from the unit
  lane; explicit targets now route to the gateway-client lane (was double-run)
- generate forceRerunTriggers from the test/vitest directory and resolve all
  entries absolute: Vitest matches triggers against absolute changed-file
  paths, so the old hand-maintained relative list never matched at all
- replace deprecated envFile:false with envDir:false (Vitest 4.1.9 warning)
- give scripts/test-live.mjs stall detection teeth: kill the process group and
  exit non-zero when OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS elapses quietly
- consolidate the live-docker shell target list into changed-lanes.mjs so the
  lane regex and check targets cannot drift; cover subagent-announce edits
- delete orphans: vitest.extension-clickclack.config.ts,
  vitest.full-core-unit.config.ts, scripts/test-docker-all.sh,
  scripts/test-live-acp-spawn-defaults-docker.sh

Closes openclaw#104231

* test: keep envDir literal so sharedVitestConfig satisfies Vite UserConfig

Vite 8 types envDir as string | false; the bare object literal widened false to
boolean and broke check:test-types at the defineConfig call sites.
steipete added a commit that referenced this pull request Jul 11, 2026
- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks,
  fixtures excluded; two Docker E2E clients that import built dist/** stay out,
  same rationale as the scripts/e2e exclusion in tsconfig.scripts.json)
- tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and
  the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348)
- changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig
  now trigger 'typecheck test root' in check:changed; previously test/ paths ran
  lint only, so harness type errors surfaced first in CI (#104287 envDir case)
- burn down all 1071 latent type errors in the program: precise param/local
  types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e
  program members; 205 sibling .d.mts declaration files for imported .mjs
  modules (committed separately); zero any, zero ts-expect-error
- resolve the pre-existing testing star-export ambiguity in
  scripts/e2e/parallels/common.ts with an explicit re-export

Closes #104388
steipete added a commit that referenced this pull request Jul 11, 2026
…04475)

* chore(types): add declaration files for scripts/lib and scripts/e2e modules

* chore(types): add declaration files for top-level script modules (a-m)

* chore(types): add declaration files for top-level script modules (n-z)

* test: use a non-secret-shaped gateway token fixture

* test: type ci workflow guard helpers for the root test lane

* chore(tooling): typecheck root test/** with a dedicated tsgo lane

- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks,
  fixtures excluded; two Docker E2E clients that import built dist/** stay out,
  same rationale as the scripts/e2e exclusion in tsconfig.scripts.json)
- tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and
  the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348)
- changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig
  now trigger 'typecheck test root' in check:changed; previously test/ paths ran
  lint only, so harness type errors surfaced first in CI (#104287 envDir case)
- burn down all 1071 latent type errors in the program: precise param/local
  types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e
  program members; 205 sibling .d.mts declaration files for imported .mjs
  modules (committed separately); zero any, zero ts-expect-error
- resolve the pre-existing testing star-export ambiguity in
  scripts/e2e/parallels/common.ts with an explicit re-export

Closes #104388

* chore(types): correct declaration fidelity per structured review

- re-derive 51 .d.mts files from implementation data flow instead of
  initializers: fix a wrong never return (runTestProjectsDelegation returns
  the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore
  the full release profile union, make parsed paths string | null, add missing
  parseArgs fields via help/non-help unions, add a missing sibling declaration
  (budget-number-args), drop 15 unused lint directives
- precise install-record/tuple typing removes the type-aware oxlint
  regressions the first declarations caused in scripts/e2e implementations
- route .mts declaration edits under test/ to the testRoot lane and reference
  the test-root project from tsconfig.projects.json so tsgo:all covers it
  (closes both review findings against the lane wiring)

* chore(scripts): keep telegram runner dist typing structural for the boundary guard

* chore(types): declare runtime pack and gateway readiness exports added on main

* test: pin the importTargetPlan form of the plugin-contract plan import

The guard expectation still referenced the raw await import( form that
7ae5996 (#103975) replaced with the importTargetPlan fallback helper;
the assertion fails on current main.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…orce-rerun triggers (openclaw#104287)

* test: fix changed-run routing, dedupe gateway package lanes, repair force-rerun triggers

- route extensions/active-memory changed runs to their dedicated lane; add a
  generic guard that every catch-all-excluded extension root resolves to a
  dedicated config so future split lanes cannot silently skip changed tests
- exclude packages/gateway-client and packages/gateway-protocol from the unit
  lane; explicit targets now route to the gateway-client lane (was double-run)
- generate forceRerunTriggers from the test/vitest directory and resolve all
  entries absolute: Vitest matches triggers against absolute changed-file
  paths, so the old hand-maintained relative list never matched at all
- replace deprecated envFile:false with envDir:false (Vitest 4.1.9 warning)
- give scripts/test-live.mjs stall detection teeth: kill the process group and
  exit non-zero when OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS elapses quietly
- consolidate the live-docker shell target list into changed-lanes.mjs so the
  lane regex and check targets cannot drift; cover subagent-announce edits
- delete orphans: vitest.extension-clickclack.config.ts,
  vitest.full-core-unit.config.ts, scripts/test-docker-all.sh,
  scripts/test-live-acp-spawn-defaults-docker.sh

Closes openclaw#104231

* test: keep envDir literal so sharedVitestConfig satisfies Vite UserConfig

Vite 8 types envDir as string | false; the bare object literal widened false to
boolean and broke check:test-types at the defineConfig call sites.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…enclaw#104475)

* chore(types): add declaration files for scripts/lib and scripts/e2e modules

* chore(types): add declaration files for top-level script modules (a-m)

* chore(types): add declaration files for top-level script modules (n-z)

* test: use a non-secret-shaped gateway token fixture

* test: type ci workflow guard helpers for the root test lane

* chore(tooling): typecheck root test/** with a dedicated tsgo lane

- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks,
  fixtures excluded; two Docker E2E clients that import built dist/** stay out,
  same rationale as the scripts/e2e exclusion in tsconfig.scripts.json)
- tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and
  the ci.yml test-types shard, mirroring the tsgo:scripts lane (openclaw#104348)
- changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig
  now trigger 'typecheck test root' in check:changed; previously test/ paths ran
  lint only, so harness type errors surfaced first in CI (openclaw#104287 envDir case)
- burn down all 1071 latent type errors in the program: precise param/local
  types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e
  program members; 205 sibling .d.mts declaration files for imported .mjs
  modules (committed separately); zero any, zero ts-expect-error
- resolve the pre-existing testing star-export ambiguity in
  scripts/e2e/parallels/common.ts with an explicit re-export

Closes openclaw#104388

* chore(types): correct declaration fidelity per structured review

- re-derive 51 .d.mts files from implementation data flow instead of
  initializers: fix a wrong never return (runTestProjectsDelegation returns
  the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore
  the full release profile union, make parsed paths string | null, add missing
  parseArgs fields via help/non-help unions, add a missing sibling declaration
  (budget-number-args), drop 15 unused lint directives
- precise install-record/tuple typing removes the type-aware oxlint
  regressions the first declarations caused in scripts/e2e implementations
- route .mts declaration edits under test/ to the testRoot lane and reference
  the test-root project from tsconfig.projects.json so tsgo:all covers it
  (closes both review findings against the lane wiring)

* chore(scripts): keep telegram runner dist typing structural for the boundary guard

* chore(types): declare runtime pack and gateway readiness exports added on main

* test: pin the importTargetPlan form of the plugin-contract plan import

The guard expectation still referenced the raw await import( form that
7250680 (openclaw#103975) replaced with the importTargetPlan fallback helper;
the assertion fails on current main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test harness: changed-run routing skips active-memory tests; unit lane double-runs gateway packages; forceRerunTriggers drift; orphan configs

1 participant