Skip to content

Commit 0bda3da

Browse files
committed
Run the setup-ide prepares a valid BSP configuration with --cli-version test for Scala CLI v1.6.0 & retry it on the CI to ward off flaky connection failures
1 parent 9853b0f commit 0bda3da

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,28 +2191,27 @@ abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
21912191
}
21922192
}
21932193

2194-
// TODO: test for the most recent CLI version as well when 1.5.1 is out
2195-
for { cliVersion <- Seq("1.5.0-34-g31a88e428-SNAPSHOT") }
2194+
for { cliVersion <- Seq("1.5.0-34-g31a88e428-SNAPSHOT", "1.6.0") }
21962195
test(
21972196
s"setup-ide prepares a valid BSP configuration with --cli-version $cliVersion"
21982197
) {
2199-
val scriptName = "cli-version.sc"
2200-
val inputs = TestInputs(
2201-
os.rel / scriptName -> s"""println("Hello from launcher v$cliVersion")"""
2202-
)
2203-
inputs.fromRoot { root =>
2204-
val cliVersionArgs = List("--cli-version", cliVersion)
2205-
os.proc(TestUtil.cli, cliVersionArgs, "setup-ide", scriptName, extraOptions).call(cwd =
2206-
root
2207-
)
2208-
val expectedIdeLauncherFile =
2209-
root / Constants.workspaceDirName / "ide-launcher-options.json"
2210-
expect(expectedIdeLauncherFile.toNIO.toFile.exists())
2211-
expect(os.read(expectedIdeLauncherFile).contains(cliVersion))
2212-
val bspConfig = readBspConfig(root)
2213-
expect(bspConfig.argv.head == TestUtil.cliPath)
2214-
expect(bspConfig.argv.containsSlice(cliVersionArgs))
2215-
expect(bspConfig.argv.indexOfSlice(cliVersionArgs) < bspConfig.argv.indexOf("bsp"))
2198+
TestUtil.retryOnCi() {
2199+
val scriptName = "cli-version.sc"
2200+
TestInputs(os.rel / scriptName -> s"""println("Hello from launcher v$cliVersion")""")
2201+
.fromRoot { root =>
2202+
val cliVersionArgs = List("--cli-version", cliVersion)
2203+
os.proc(TestUtil.cli, cliVersionArgs, "setup-ide", scriptName, extraOptions).call(cwd =
2204+
root
2205+
)
2206+
val expectedIdeLauncherFile =
2207+
root / Constants.workspaceDirName / "ide-launcher-options.json"
2208+
expect(expectedIdeLauncherFile.toNIO.toFile.exists())
2209+
expect(os.read(expectedIdeLauncherFile).contains(cliVersion))
2210+
val bspConfig = readBspConfig(root)
2211+
expect(bspConfig.argv.head == TestUtil.cliPath)
2212+
expect(bspConfig.argv.containsSlice(cliVersionArgs))
2213+
expect(bspConfig.argv.indexOfSlice(cliVersionArgs) < bspConfig.argv.indexOf("bsp"))
2214+
}
22162215
}
22172216
}
22182217

0 commit comments

Comments
 (0)