perf: reduce hot test imports and duplicate scans · openclaw/openclaw@9f9bcfe
steipete
·
2026-04-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,10 @@ import { logWarn } from "../logger.js";
|
27 | 27 | import type { ManagedRun } from "../process/supervisor/index.js"; |
28 | 28 | import { getProcessSupervisor } from "../process/supervisor/index.js"; |
29 | 29 | import type { RunExit, TerminationReason } from "../process/supervisor/types.js"; |
30 | | -import { normalizeDeliveryContext, type DeliveryContext } from "../utils/delivery-context.js"; |
| 30 | +import { |
| 31 | +normalizeDeliveryContext, |
| 32 | +type DeliveryContext, |
| 33 | +} from "../utils/delivery-context.shared.js"; |
31 | 34 | import { |
32 | 35 | addSession, |
33 | 36 | appendOutput, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,8 +6,9 @@ import {
|
6 | 6 | } from "../../scripts/test-live-shard.mjs"; |
7 | 7 | |
8 | 8 | describe("scripts/test-live-shard", () => { |
| 9 | +const allFiles = collectAllLiveTestFiles(); |
| 10 | + |
9 | 11 | it("partitions every native live test into exactly one release shard", () => { |
10 | | -const allFiles = collectAllLiveTestFiles(); |
11 | 12 | const selected = LIVE_TEST_SHARDS.flatMap((shard) => |
12 | 13 | selectLiveShardFiles(shard, allFiles).map((file) => ({ file, shard })), |
13 | 14 | ); |
@@ -19,8 +20,6 @@ describe("scripts/test-live-shard", () => {
|
19 | 20 | }); |
20 | 21 | |
21 | 22 | it("keeps slow gateway backend and media-capable extension files in their own shards", () => { |
22 | | -const allFiles = collectAllLiveTestFiles(); |
23 | | - |
24 | 23 | expect(selectLiveShardFiles("native-live-src-gateway-backends", allFiles)).toEqual( |
25 | 24 | expect.arrayContaining([ |
26 | 25 | "src/gateway/gateway-acp-bind.live.test.ts", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。