@@ -62,6 +62,7 @@ import kotlin.test.assertFalse
6262import kotlin.test.assertNotEquals
6363import kotlin.test.assertTrue
6464
65+ private const val VERSION_FOR_PROGRESS_REPORTING = " v2.23.1-devel+de07351b8"
6566private val noOpTextProgress: (String ) -> Unit = { _ -> }
6667
6768internal class CoderCLIManagerTest {
@@ -147,7 +148,7 @@ internal class CoderCLIManagerTest {
147148 val ex =
148149 assertFailsWith(
149150 exceptionClass = ResponseException ::class ,
150- block = { ccm.download(noOpTextProgress) },
151+ block = { ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress) },
151152 )
152153 assertEquals(HttpURLConnection .HTTP_INTERNAL_ERROR , ex.code)
153154
@@ -202,7 +203,7 @@ internal class CoderCLIManagerTest {
202203
203204 assertFailsWith(
204205 exceptionClass = AccessDeniedException ::class ,
205- block = { ccm.download(noOpTextProgress) },
206+ block = { ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress) },
206207 )
207208
208209 srv.stop(0 )
@@ -231,11 +232,11 @@ internal class CoderCLIManagerTest {
231232 ).readOnly(),
232233 )
233234
234- assertTrue(ccm.download(noOpTextProgress))
235+ assertTrue(ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
235236 assertDoesNotThrow { ccm.version() }
236237
237238 // It should skip the second attempt.
238- assertFalse(ccm.download(noOpTextProgress))
239+ assertFalse(ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
239240
240241 // Make sure login failures propagate.
241242 assertFailsWith(
@@ -260,11 +261,11 @@ internal class CoderCLIManagerTest {
260261 ).readOnly(),
261262 )
262263
263- assertEquals(true , ccm.download(noOpTextProgress))
264+ assertEquals(true , ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
264265 assertEquals(SemVer (url.port.toLong(), 0 , 0 ), ccm.version())
265266
266267 // It should skip the second attempt.
267- assertEquals(false , ccm.download(noOpTextProgress))
268+ assertEquals(false , ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
268269
269270 // Should use the source override.
270271 ccm = CoderCLIManager (
@@ -280,7 +281,7 @@ internal class CoderCLIManagerTest {
280281 ).readOnly(),
281282 )
282283
283- assertEquals(true , ccm.download(noOpTextProgress))
284+ assertEquals(true , ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
284285 assertContains(ccm.localBinaryPath.toFile().readText(), " 0.0.0" )
285286
286287 srv.stop(0 )
@@ -328,7 +329,7 @@ internal class CoderCLIManagerTest {
328329 assertEquals(" cli" , ccm.localBinaryPath.toFile().readText())
329330 assertEquals(0 , ccm.localBinaryPath.toFile().lastModified())
330331
331- assertTrue(ccm.download(noOpTextProgress))
332+ assertTrue(ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
332333
333334 assertNotEquals(" cli" , ccm.localBinaryPath.toFile().readText())
334335 assertNotEquals(0 , ccm.localBinaryPath.toFile().lastModified())
@@ -353,8 +354,8 @@ internal class CoderCLIManagerTest {
353354 val ccm1 = CoderCLIManager (url1, context.logger, settings)
354355 val ccm2 = CoderCLIManager (url2, context.logger, settings)
355356
356- assertTrue(ccm1.download(noOpTextProgress))
357- assertTrue(ccm2.download(noOpTextProgress))
357+ assertTrue(ccm1.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
358+ assertTrue(ccm2.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
358359
359360 srv1.stop(0 )
360361 srv2.stop(0 )
@@ -957,7 +958,7 @@ internal class CoderCLIManagerTest {
957958 context.logger,
958959 ).readOnly(),
959960 )
960- assertEquals(true , ccm.download(noOpTextProgress))
961+ assertEquals(true , ccm.download(VERSION_FOR_PROGRESS_REPORTING , noOpTextProgress))
961962 assertEquals(it.second, ccm.features, " version: ${it.first} " )
962963
963964 srv.stop(0 )
0 commit comments