@@ -2024,8 +2024,11 @@ describe("scripts/test-projects changed-target routing", () => {
20242024 ] ) ;
20252025 } ) ;
20262026
2027- it ( "chunks the broad shell helper tooling shard after isolated targets" , ( ) => {
2028- const plans = buildVitestRunPlans ( [ "test/scripts" ] , process . cwd ( ) ) ;
2027+ it . each ( [
2028+ [ "chunks the broad shell helper tooling shard after isolated targets" , "test/scripts" ] ,
2029+ [ "chunks broad shell helper globs after isolated targets" , "test/scripts/*.test.ts" ] ,
2030+ ] ) ( "%s" , ( _title , target ) => {
2031+ const plans = buildVitestRunPlans ( [ target ] , process . cwd ( ) ) ;
20292032 expect ( plans . slice ( 0 , 4 ) ) . toEqual ( [
20302033 expect . objectContaining ( {
20312034 config : "test/vitest/vitest.unit-fast.config.ts" ,
@@ -2214,70 +2217,6 @@ describe("scripts/test-projects changed-target routing", () => {
22142217 ) ;
22152218 } ) ;
22162219
2217- it ( "chunks broad shell helper globs after isolated targets" , ( ) => {
2218- const plans = buildVitestRunPlans ( [ "test/scripts/*.test.ts" ] , process . cwd ( ) ) ;
2219- expect ( plans . slice ( 0 , 4 ) ) . toEqual ( [
2220- expect . objectContaining ( {
2221- config : "test/vitest/vitest.unit-fast.config.ts" ,
2222- includePatterns : expect . arrayContaining ( [ "test/scripts/arg-utils.test.ts" ] ) ,
2223- watchMode : false ,
2224- } ) ,
2225- {
2226- config : "test/vitest/vitest.unit-fast-isolated.config.ts" ,
2227- forwardedArgs : [ ] ,
2228- includePatterns : [
2229- "test/scripts/android-version.test.ts" ,
2230- "test/scripts/ios-release-plan.test.ts" ,
2231- ] ,
2232- watchMode : false ,
2233- } ,
2234- {
2235- config : "test/vitest/vitest.tooling-docker.config.ts" ,
2236- forwardedArgs : [ ] ,
2237- includePatterns : [ "test/scripts/docker-build-helper.test.ts" ] ,
2238- watchMode : false ,
2239- } ,
2240- {
2241- config : "test/vitest/vitest.tooling-isolated.config.ts" ,
2242- forwardedArgs : [ ] ,
2243- includePatterns : [
2244- "test/scripts/check-extension-package-tsc-boundary.test.ts" ,
2245- "test/scripts/check-plugin-sdk-wildcard-reexports.test.ts" ,
2246- "test/scripts/control-ui-i18n.test.ts" ,
2247- "test/scripts/openclaw-e2e-instance.test.ts" ,
2248- "test/scripts/test-projects-build-admission.test.ts" ,
2249- "test/scripts/vitest-fork-shutdown.test.ts" ,
2250- ] ,
2251- watchMode : false ,
2252- } ,
2253- ] ) ;
2254- const e2ePlans = plans . filter ( ( plan ) => plan . config === "test/vitest/vitest.e2e.config.ts" ) ;
2255- const toolingPlans = plans
2256- . slice ( 4 )
2257- . filter ( ( plan ) => plan . config === "test/vitest/vitest.tooling.config.ts" ) ;
2258- const toolingTargets = toolingPlans . flatMap ( ( plan ) => plan . includePatterns ?? [ ] ) ;
2259-
2260- expect ( toolingPlans . length ) . toBeGreaterThan ( 1 ) ;
2261- expect ( toolingPlans . every ( ( plan ) => ( plan . includePatterns ?. length ?? 0 ) <= 60 ) ) . toBe ( true ) ;
2262- expect ( toolingTargets ) . toContain ( "test/scripts/run-opengrep.test.ts" ) ;
2263- expect ( toolingTargets ) . not . toContain ( "test/scripts/docker-build-helper.test.ts" ) ;
2264- expect ( toolingTargets ) . not . toContain ( "test/scripts/openclaw-e2e-instance.test.ts" ) ;
2265- expect ( new Set ( toolingTargets ) . size ) . toBe ( toolingTargets . length ) ;
2266- expect ( e2ePlans ) . toEqual ( [
2267- {
2268- config : "test/vitest/vitest.e2e.config.ts" ,
2269- forwardedArgs : [
2270- "test/scripts/doctor-config-preflight-plugin-index.built-cli.e2e.test.ts" ,
2271- "test/scripts/mcp-channels-seed.built-cli.e2e.test.ts" ,
2272- "test/scripts/sqlite-sessions-transcripts-flip-proof.built-cli.e2e.test.ts" ,
2273- "test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts" ,
2274- ] ,
2275- includePatterns : null ,
2276- watchMode : false ,
2277- } ,
2278- ] ) ;
2279- } ) ;
2280-
22812220 it ( "keeps broad shell helper watch targets in one tooling shard" , ( ) => {
22822221 expectSingleVitestRunPlan ( buildVitestRunPlans ( [ "--watch" , "test/scripts" ] , process . cwd ( ) ) , {
22832222 config : "test/vitest/vitest.tooling.config.ts" ,
0 commit comments