Skip to content

Commit dac0ef6

Browse files
authored
fix(test): bound Testbox agentic and extension suites (#115696)
* fix(test): split Testbox extension processes * fix(test): split Testbox agentic processes
1 parent 7a9d2c3 commit dac0ef6

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

‎scripts/pr-lib/gates.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ run_remote_testbox_full_test_gate() {
193193
--ttl 240m \
194194
--timing-json \
195195
--label "$lease_label" \
196-
-- env CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=install corepack pnpm test
196+
-- env CI=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=install corepack pnpm test
197197
}
198198

199199
read_remote_testbox_gate_stamp() {

‎scripts/test-projects.test-support.mjs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ const EXTENSION_VOICE_CALL_VITEST_CONFIG = "test/vitest/vitest.extension-voice-c
171171
const EXTENSION_WHATSAPP_VITEST_CONFIG = "test/vitest/vitest.extension-whatsapp.config.ts";
172172
const EXTENSION_ZALO_VITEST_CONFIG = "test/vitest/vitest.extension-zalo.config.ts";
173173
const EXTENSIONS_VITEST_CONFIG = "test/vitest/vitest.extensions.config.ts";
174+
const FULL_AGENTIC_VITEST_CONFIG = "test/vitest/vitest.full-agentic.config.ts";
174175
const FULL_EXTENSIONS_VITEST_CONFIG = "test/vitest/vitest.full-extensions.config.ts";
175176
const GATEWAY_CLIENT_VITEST_CONFIG = "test/vitest/vitest.gateway-client.config.ts";
176177
const GATEWAY_CORE_VITEST_CONFIG = "test/vitest/vitest.gateway-core.config.ts";
@@ -4758,7 +4759,13 @@ export function buildFullSuiteVitestRunPlans(args, cwd = process.cwd()) {
47584759
) {
47594760
return [];
47604761
}
4761-
const expandShard = expandToProjectConfigs;
4762+
// The remote Testbox full gate runs every agentic and extension project in one process tree.
4763+
// Bound project and worker lifetimes before either aggregate reaches V8's heap limit.
4764+
const expandShard =
4765+
expandToProjectConfigs ||
4766+
(process.env.OPENCLAW_TESTBOX_REMOTE_RUN === "1" &&
4767+
(shard.config === FULL_AGENTIC_VITEST_CONFIG ||
4768+
shard.config === FULL_EXTENSIONS_VITEST_CONFIG));
47624769
const configs = expandShard ? shard.projects : [shard.config];
47634770
return configs.flatMap((config) => {
47644771
if (expandShard && targetArgs.length === 0) {

‎test/scripts/pr-prepare-gates.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ describe("remote testbox gate delegation", () => {
434434
"--blacksmith-ref main " +
435435
"--idle-timeout 90m --ttl 240m --timing-json " +
436436
"--label pr-424242-gates " +
437-
"-- env CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=install corepack pnpm test",
437+
"-- env CI=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 " +
438+
"PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=install corepack pnpm test",
438439
);
439440
});
440441

‎test/scripts/test-projects.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,6 +4645,7 @@ describe("scripts/test-projects full-suite sharding", () => {
46454645
it("keeps CI=1 full-suite runs on aggregate shard configs", () => {
46464646
vi.stubEnv("CI", "1");
46474647
vi.stubEnv("GITHUB_ACTIONS", "");
4648+
vi.stubEnv("OPENCLAW_TESTBOX_REMOTE_RUN", "");
46484649
vi.stubEnv("OPENCLAW_TEST_PROJECTS_LEAF_SHARDS", "");
46494650
vi.stubEnv("OPENCLAW_TEST_PROJECTS_PARALLEL", "");
46504651
try {
@@ -4710,6 +4711,24 @@ describe("scripts/test-projects full-suite sharding", () => {
47104711
expect(specs[0]?.env.NODE_OPTIONS).toBe("--max-old-space-size=12288 --max_old_space_size=8192");
47114712
});
47124713

4714+
it("splits the Testbox agentic and extension shards into bounded processes", () => {
4715+
vi.stubEnv("CI", "1");
4716+
vi.stubEnv("GITHUB_ACTIONS", "");
4717+
vi.stubEnv("OPENCLAW_TESTBOX_REMOTE_RUN", "1");
4718+
vi.stubEnv("OPENCLAW_TEST_PROJECTS_LEAF_SHARDS", "");
4719+
vi.stubEnv("OPENCLAW_TEST_PROJECTS_PARALLEL", "");
4720+
try {
4721+
const configs = buildFullSuiteVitestRunPlans([], process.cwd()).map((plan) => plan.config);
4722+
4723+
expect(configs).not.toContain("test/vitest/vitest.full-agentic.config.ts");
4724+
expect(configs).not.toContain("test/vitest/vitest.full-extensions.config.ts");
4725+
expect(configs).toContain("test/vitest/vitest.agents-core.config.ts");
4726+
expect(configs).toContain("test/vitest/vitest.extension-telegram.config.ts");
4727+
} finally {
4728+
vi.unstubAllEnvs();
4729+
}
4730+
});
4731+
47134732
it("keeps explicit parallel overrides ahead of the host-aware profile", () => {
47144733
expect(
47154734
resolveParallelFullSuiteConcurrency(

0 commit comments

Comments
 (0)