@@ -136,6 +136,37 @@ class E2ETest {
136136 testE2E(emptyList(), emptyList(), " /fixture/impacted_targets-1-2.txt" )
137137 }
138138
139+ @Test
140+ fun testDetermineBazelVersion () {
141+ // E2E coverage for BazelQueryService.determineBazelVersion(): version is resolved lazily
142+ // when the first query runs. Running generate-hashes to completion validates that
143+ // "bazel version" is executed and parsed successfully (e.g. "Build label: X.Y.Z").
144+ val projectA = extractFixtureProject(" /fixture/integration-test-1.zip" )
145+ val workingDirectory = File (projectA, " integration" )
146+ val outputDir = temp.newFolder()
147+ val outputPath = File (outputDir, " hashes.json" )
148+
149+ val cli = CommandLine (BazelDiff ())
150+ val exitCode = cli.execute(
151+ " generate-hashes" ,
152+ " -w" ,
153+ workingDirectory.absolutePath,
154+ " -b" ,
155+ " bazel" ,
156+ outputPath.absolutePath)
157+
158+ assertThat(exitCode).isEqualTo(0 )
159+ assertThat(outputPath.readText().isNotEmpty()).isEqualTo(true )
160+ }
161+
162+ @Test
163+ fun testE2EWithNoKeepGoing () {
164+ testE2E(
165+ listOf (" --no-keep_going" ),
166+ emptyList(),
167+ " /fixture/impacted_targets-1-2.txt" )
168+ }
169+
139170 @Test
140171 fun testE2EIncludingTargetType () {
141172 testE2E(
@@ -996,6 +1027,19 @@ class E2ETest {
9961027 // which is designed to fail during analysis
9971028 assertThat(exitCodeWithCquery).isEqualTo(1 )
9981029
1030+ // Test with --no-keep_going: cquery should fail (no partial results, immediate failure)
1031+ val outputNoKeepGoing = File (outputDir, " hashes_no_keep_going.json" )
1032+ val exitCodeWithNoKeepGoing = cli.execute(
1033+ " generate-hashes" ,
1034+ " -w" ,
1035+ workspace.absolutePath,
1036+ " -b" ,
1037+ " bazel" ,
1038+ " --useCquery" ,
1039+ " --no-keep_going" ,
1040+ outputNoKeepGoing.absolutePath)
1041+ assertThat(exitCodeWithNoKeepGoing).isEqualTo(1 )
1042+
9991043 // Test with --keep_going enabled (default behavior)
10001044 // With keep_going, cquery returns partial results but still exits with code 1
10011045 // The current implementation allows exit codes 0 and 3, but cquery with keep_going
0 commit comments