@@ -255,8 +255,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
255255
256256 @Test
257257 fun testModuleChangesWithoutWorkspace () {
258- // When module changes occur but no workspace is provided, fall back to hash comparison
259- // This correctly supports fine-grained external repo hashing where only changed external targets are marked
258+ // When module changes occur and query service is not available, all targets are marked as impacted
260259 val startHashes = mapOf (
261260 " //:target1" to TargetHash (" " , " hash1" , " hash1" ),
262261 " //:target2" to TargetHash (" " , " hash2" , " hash2" ),
@@ -304,13 +303,12 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
304303 outputWriter = outputWriter,
305304 targetTypes = null ,
306305 fromModuleGraphJson = fromModuleGraph,
307- toModuleGraphJson = toModuleGraph,
308- canQueryWorkspace = false
306+ toModuleGraphJson = toModuleGraph
309307 )
310308
311309 val output = outputWriter.toString().trim().split(" \n " )
312- // Without workspace, falls back to hash comparison - only external target is impacted
313- assertThat(output).containsExactlyInAnyOrder(" @@abseil-cpp~20240722.0//:strings" )
310+ // Module changes detected but no query service available - all targets including external are impacted
311+ assertThat(output).containsExactlyInAnyOrder(" //:target1 " , " //:target2 " , " @@abseil-cpp~20240722.0//:strings" )
314312 }
315313
316314 @Test
@@ -363,8 +361,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
363361 outputWriter = outputWriter,
364362 targetTypes = null ,
365363 fromModuleGraphJson = fromModuleGraph,
366- toModuleGraphJson = toModuleGraph,
367- canQueryWorkspace = true
364+ toModuleGraphJson = toModuleGraph
368365 )
369366
370367 val output = outputWriter.toString().trim().split(" \n " )
@@ -403,8 +400,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
403400 outputWriter = outputWriter,
404401 targetTypes = null ,
405402 fromModuleGraphJson = moduleGraph,
406- toModuleGraphJson = moduleGraph, // Same module graph
407- canQueryWorkspace = false
403+ toModuleGraphJson = moduleGraph // Same module graph
408404 )
409405
410406 val output = outputWriter.toString().trim().split(" \n " )
@@ -414,8 +410,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
414410
415411 @Test
416412 fun testModuleChangesWithDistances () {
417- // Test executeWithDistances with module changes but no workspace
418- // Without workspace, falls back to hash comparison
413+ // Test executeWithDistances with module changes - when query service is not available, all targets are marked as impacted
419414 val startHashes = mapOf (
420415 " //:1" to TargetHash (" " , " //:1" , " //:1" ),
421416 " //:2" to TargetHash (" " , " //:2" , " //:2" ),
@@ -462,15 +457,14 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
462457 outputWriter = outputWriter,
463458 targetTypes = null ,
464459 fromModuleGraphJson = fromModuleGraph,
465- toModuleGraphJson = toModuleGraph,
466- canQueryWorkspace = false
460+ toModuleGraphJson = toModuleGraph
467461 )
468462
469463 val output = outputWriter.toString()
470- // Without workspace, falls back to hash comparison - only //:1 changed
464+ // Module changes detected but no query service available - all targets are marked as impacted
471465 assertThat(output).contains(" //:1" )
472- assertThat(output).doesNotContain (" //:2" )
473- assertThat(output).doesNotContain (" //:3" )
466+ assertThat(output).contains (" //:2" )
467+ assertThat(output).contains (" //:3" )
474468 assertThat(output).contains(" \" targetDistance\" : 0" )
475469 assertThat(output).contains(" \" packageDistance\" : 0" )
476470 }
@@ -497,8 +491,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
497491 outputWriter = outputWriter,
498492 targetTypes = null ,
499493 fromModuleGraphJson = null , // Missing module graph
500- toModuleGraphJson = null ,
501- canQueryWorkspace = true
494+ toModuleGraphJson = null
502495 )
503496
504497 val output = outputWriter.toString().trim().split(" \n " )
@@ -541,8 +534,7 @@ class CalculateImpactedTargetsInteractorTest : KoinTest {
541534 outputWriter = outputWriter,
542535 targetTypes = null ,
543536 fromModuleGraphJson = moduleGraph, // Identical module graphs
544- toModuleGraphJson = moduleGraph,
545- canQueryWorkspace = true
537+ toModuleGraphJson = moduleGraph
546538 )
547539
548540 val output = outputWriter.toString().trim().split(" \n " )
0 commit comments