Skip to content

Commit be29197

Browse files
committed
drop bloop in CI
1 parent 4b393e3 commit be29197

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

testops/src/main/scala/sloth/ExampleRunner.scala

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ import sloth.patching.BytecodePatcher
2222
*/
2323
object BloopWarmup {
2424
// First access boots the daemon; concurrent accessors block on lazy-val init until it's ready.
25+
// Skipped on CI where --server=false disables Bloop entirely.
2526
private lazy val booted: Unit = {
26-
val dir = os.temp.dir(prefix = "sloth-bloop-warmup-")
27-
os.write.over(dir / "Warmup.scala", "object Warmup\n")
28-
// Generous startup timeout so a cold daemon (JVM download + start) doesn't trip the 30s default.
29-
os.proc("scala-cli", "compile", "--jvm", "17", "--bloop-startup-timeout", "180s", "-S", "3.3.8", dir.toString)
30-
.call(check = false, stderr = os.Pipe, stdout = os.Pipe)
31-
os.remove.all(dir)
27+
if (!TestPaths.isCI) {
28+
val dir = os.temp.dir(prefix = "sloth-bloop-warmup-")
29+
os.write.over(dir / "Warmup.scala", "object Warmup\n")
30+
os.proc("scala-cli", "compile", "--jvm", "17", "--bloop-startup-timeout", "180s", "-S", "3.3.8", dir.toString)
31+
.call(check = false, stderr = os.Pipe, stdout = os.Pipe)
32+
os.remove.all(dir)
33+
}
3234
}
3335

34-
/** Ensure the Bloop daemon is running before launching parallel compilations. Idempotent. */
36+
/** Ensure the Bloop daemon is running before launching parallel compilations. Idempotent. No-op on CI. */
3537
def ensure(): Unit = booted
3638
}
3739

@@ -121,7 +123,7 @@ class ExampleRunner(
121123
// default target and is therefore only run on the JDK-25 leg (used as a static reference here).
122124
val releaseArgs = if (scalaVersion.startsWith("3.8")) Seq.empty else Seq("--release", "9")
123125
val result = os
124-
.proc("scala-cli", "compile", "--jvm", "17", "--bloop-startup-timeout", "180s", releaseArgs, "-S", scalaVersion, targetDir.toString)
126+
.proc("scala-cli", "compile", "--jvm", "17", TestPaths.scalaCliServerArgs, releaseArgs, "-S", scalaVersion, targetDir.toString)
125127
.call(cwd = targetDir, stderr = os.Pipe, stdout = os.Pipe, check = false)
126128

127129
// Only log output if compilation failed or not in quiet mode

testops/src/main/scala/sloth/TestPaths.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ package sloth
77
*/
88
object TestPaths {
99

10+
val isCI: Boolean = sys.env.contains("CI")
11+
12+
/** Extra scala-cli flags for CI: skip Bloop to avoid daemon contention on resource-constrained runners. */
13+
val scalaCliServerArgs: Seq[String] =
14+
if isCI then Seq("--server=false") else Seq("--bloop-startup-timeout", "180s")
15+
1016
/** Locate the assembled agent jar under agent/target/ without hard-coding the Scala version in
1117
* the path. The agent sets crossPaths := false so the jar lands directly in agent/target/, but
1218
* we search recursively to stay robust against build layout changes.

tests-jdk11/src/test/scala/sloth/Jdk9RuntimeTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Jdk9RuntimeTests extends FunSuite with ExampleLoader {
5757

5858
/** Full classpath (scala-library + deps) for a compiled example, via scala-cli. */
5959
def getScalaCliClasspath(targetDir: os.Path, scalaVersion: String): String =
60-
os.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", "--release", "9", "--bloop-startup-timeout", "180s", "-S", scalaVersion, targetDir.toString)
60+
os.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", "--release", "9", TestPaths.scalaCliServerArgs, "-S", scalaVersion, targetDir.toString)
6161
.call(cwd = targetDir, stderr = os.Pipe, stdout = os.Pipe)
6262
.out.text().trim
6363

tests-jdk25/src/test/scala/sloth/AgentIntegrationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ class AgentIntegrationTests extends FunSuite {
5555
os.write(tempDir / "AgentTestApp.scala", testSource)
5656

5757
println(s"Compiling test source with Scala $scalaVersion...")
58-
os.proc("scala-cli", "compile", "--jvm", "17", "--bloop-startup-timeout", "180s", "-S", scalaVersion, tempDir.toString)
58+
os.proc("scala-cli", "compile", "--jvm", "17", TestPaths.scalaCliServerArgs, "-S", scalaVersion, tempDir.toString)
5959
.call(cwd = tempDir, stdout = os.Inherit, stderr = os.Inherit)
6060

6161
// Get classpath
62-
val cpResult = os.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", "--bloop-startup-timeout", "180s", "-S", scalaVersion, tempDir.toString)
62+
val cpResult = os.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", TestPaths.scalaCliServerArgs, "-S", scalaVersion, tempDir.toString)
6363
.call(cwd = tempDir, stderr = os.Pipe, stdout = os.Pipe)
6464
classpath = cpResult.out.text().trim
6565

tests-jdk25/src/test/scala/sloth/BytecodePatchingTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class BytecodePatchingTests extends FunSuite with ExampleLoader {
258258
*/
259259
def getScalaCliClasspath(targetDir: os.Path, scalaVersion: String): String = {
260260
val result = os
261-
.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", "--bloop-startup-timeout", "180s", "-S", scalaVersion, targetDir.toString)
261+
.proc("scala-cli", "compile", "--print-classpath", "--jvm", "17", TestPaths.scalaCliServerArgs, "-S", scalaVersion, targetDir.toString)
262262
.call(cwd = targetDir, stderr = os.Pipe, stdout = os.Pipe)
263263

264264
result.out.text().trim

0 commit comments

Comments
 (0)