@@ -196,6 +196,7 @@ describe("scripts/test-projects changed-target routing", () => {
196196describe ( "scripts/test-projects full-suite sharding" , ( ) => {
197197 it ( "splits untargeted runs into fixed shard configs" , ( ) => {
198198 delete process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
199+ delete process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD ;
199200
200201 expect ( buildFullSuiteVitestRunPlans ( [ ] , process . cwd ( ) ) . map ( ( plan ) => plan . config ) ) . toEqual ( [
201202 "vitest.full-core-unit-fast.config.ts" ,
@@ -213,14 +214,35 @@ describe("scripts/test-projects full-suite sharding", () => {
213214 ] ) ;
214215 } ) ;
215216
217+ it ( "can skip the aggregate extension shard when CI runs dedicated extension shards" , ( ) => {
218+ const previous = process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD ;
219+ process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = "1" ;
220+ try {
221+ const configs = buildFullSuiteVitestRunPlans ( [ ] , process . cwd ( ) ) . map ( ( plan ) => plan . config ) ;
222+
223+ expect ( configs ) . not . toContain ( "vitest.full-extensions.config.ts" ) ;
224+ expect ( configs ) . toContain ( "vitest.full-auto-reply.config.ts" ) ;
225+ } finally {
226+ if ( previous === undefined ) {
227+ delete process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD ;
228+ } else {
229+ process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = previous ;
230+ }
231+ }
232+ } ) ;
233+
216234 it ( "can expand full-suite shards to project configs for perf experiments" , ( ) => {
217235 const previous = process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
218236 process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = "1" ;
219- const plans = buildFullSuiteVitestRunPlans ( [ ] , process . cwd ( ) ) ;
220- if ( previous === undefined ) {
221- delete process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
222- } else {
223- process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previous ;
237+ let plans : ReturnType < typeof buildFullSuiteVitestRunPlans > ;
238+ try {
239+ plans = buildFullSuiteVitestRunPlans ( [ ] , process . cwd ( ) ) ;
240+ } finally {
241+ if ( previous === undefined ) {
242+ delete process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
243+ } else {
244+ process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previous ;
245+ }
224246 }
225247
226248 expect ( plans . map ( ( plan ) => plan . config ) ) . toEqual ( [
@@ -290,6 +312,31 @@ describe("scripts/test-projects full-suite sharding", () => {
290312 ) ;
291313 } ) ;
292314
315+ it ( "skips extension project configs when leaf sharding and the aggregate extension shard is disabled" , ( ) => {
316+ const previousLeafShards = process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
317+ const previousSkipExtensions = process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD ;
318+ process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = "1" ;
319+ process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = "1" ;
320+ try {
321+ const configs = buildFullSuiteVitestRunPlans ( [ ] , process . cwd ( ) ) . map ( ( plan ) => plan . config ) ;
322+
323+ expect ( configs ) . not . toContain ( "vitest.extensions.config.ts" ) ;
324+ expect ( configs ) . not . toContain ( "vitest.extension-providers.config.ts" ) ;
325+ expect ( configs ) . toContain ( "vitest.auto-reply-reply.config.ts" ) ;
326+ } finally {
327+ if ( previousLeafShards === undefined ) {
328+ delete process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS ;
329+ } else {
330+ process . env . OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previousLeafShards ;
331+ }
332+ if ( previousSkipExtensions === undefined ) {
333+ delete process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD ;
334+ } else {
335+ process . env . OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = previousSkipExtensions ;
336+ }
337+ }
338+ } ) ;
339+
293340 it ( "keeps untargeted watch mode on the native root config" , ( ) => {
294341 expect ( buildFullSuiteVitestRunPlans ( [ "--watch" ] , process . cwd ( ) ) ) . toEqual ( [
295342 {
0 commit comments