Skip to content

Commit b9e65fc

Browse files
committed
Fix Scala 2 nightly test failures by tagging them as flaky or skipping
1 parent 1b1214e commit b9e65fc

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

modules/build/src/test/scala/scala/build/tests/BuildOptionsTests.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import scala.build.internal.Regexes.scala3LtsRegex
3333
import scala.build.errors.ScalaVersionError
3434

3535
class BuildOptionsTests extends TestUtil.ScalaCliBuildSuite {
36+
override def munitFlakyOK: Boolean = TestUtil.isCI
3637

3738
val extraRepoTmpDir = os.temp.dir(prefix = "scala-cli-tests-extra-repo-")
3839
val directories = Directories.under(extraRepoTmpDir)
@@ -217,7 +218,7 @@ class BuildOptionsTests extends TestUtil.ScalaCliBuildSuite {
217218
)
218219
}
219220

220-
test("-S 2.nightly option works") {
221+
test("-S 2.nightly option works".flaky) {
221222
val options = BuildOptions(
222223
scalaOptions = ScalaOptions(
223224
scalaVersion = Some(MaybeScalaVersion("2.nightly"))
@@ -230,7 +231,7 @@ class BuildOptionsTests extends TestUtil.ScalaCliBuildSuite {
230231
)
231232
}
232233

233-
test("-S 2.13.nightly option works") {
234+
test("-S 2.13.nightly option works".flaky) {
234235
val options = BuildOptions(
235236
scalaOptions = ScalaOptions(
236237
scalaVersion = Some(MaybeScalaVersion("2.13.nightly"))
@@ -256,7 +257,7 @@ class BuildOptionsTests extends TestUtil.ScalaCliBuildSuite {
256257
)
257258
}
258259

259-
test("-S 2.12.nightly option works") {
260+
test("-S 2.12.nightly option works".flaky) {
260261
val options = BuildOptions(
261262
scalaOptions = ScalaOptions(
262263
scalaVersion = Some(MaybeScalaVersion("2.12.nightly"))
@@ -269,7 +270,7 @@ class BuildOptionsTests extends TestUtil.ScalaCliBuildSuite {
269270
)
270271
}
271272

272-
test("-S 2.13.9-bin-4505094 option works without repo specification") {
273+
test("-S 2.13.9-bin-4505094 option works without repo specification".flaky) {
273274
val options = BuildOptions(
274275
scalaOptions = ScalaOptions(
275276
scalaVersion = Some(MaybeScalaVersion("2.13.9-bin-4505094"))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.eed3si9n.expecty.Expecty.expect
55
import scala.util.Properties
66

77
class ReplTests213 extends ReplTestDefinitions with Test213 {
8-
test("repl custom repositories work") {
8+
test("repl custom repositories work".flaky) {
99
TestInputs.empty.fromRoot { root =>
1010
os.proc(
1111
TestUtil.cli,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,6 @@ trait RunScalacCompatTestDefinitions {
377377
}
378378
}
379379

380-
override def munitFlakyOK: Boolean = TestUtil.isCI && Properties.isMac && TestUtil.isNativeCli
381-
382380
def verifyScala212VersionCompiles(scalaPatchVersion: String): Unit = {
383381
TestInputs(os.rel / "s.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
384382
root =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RunTests212 extends RunTestDefinitions with Test212 {
2626
)
2727
}
2828
}
29-
test("2.12.nightly") {
29+
test("2.12.nightly".flaky) {
3030
TestInputs(os.rel / "sample.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
3131
root =>
3232
val res =

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package scala.cli.integration
33
import com.eed3si9n.expecty.Expecty.expect
44

55
class RunTests213 extends RunTestDefinitions with Test213 {
6-
test("ensure typesafe PR validation snapshot Scala versions are supported") {
6+
test("ensure typesafe PR validation snapshot Scala versions are supported".flaky) {
77
TestInputs(os.rel / "sample.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
88
root =>
99
val snapshotScalaVersion = "2.13.11-bin-89f3de5-SNAPSHOT"
@@ -22,7 +22,7 @@ class RunTests213 extends RunTestDefinitions with Test213 {
2222
expect(res.out.trim() == "2.13.11-20221128-143922-89f3de5")
2323
}
2424
}
25-
test("2.13.nightly") {
25+
test("2.13.nightly".flaky) {
2626
TestInputs(os.rel / "sample.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
2727
root =>
2828
val res =

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ abstract class ScalaCliSuite extends munit.FunSuite {
3232
Option(System.getenv("SCALA_CLI_IT_GROUP"))
3333
.flatMap(_.toIntOption)
3434
.exists(_ != group.idx)
35+
36+
override def munitFlakyOK: Boolean = TestUtil.isCI
3537
}
3638

3739
object ScalaCliSuite {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ class SipScalaTests extends ScalaCliSuite with SbtTestHelper with MillTestHelper
665665
}
666666

667667
test(
668-
s"default Scala version ($sv2) coming straight from a predefined local repository $withBloopString"
668+
s"default Scala version ($sv2) coming straight from a predefined local repository $withBloopString".flaky
669669
) {
670670
TestInputs(
671671
os.rel / "simple.sc" -> "println(scala.util.Properties.versionNumberString)"

website/docs/commands/compile.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ having to pass their addresses as input after the `--repo` flag.
9999

100100
For compiling with the latest Scala 2 nightly build:
101101

102-
```bash
102+
```bash ignore
103103
scala-cli Hello.scala -S 2.nightly
104104
```
105105

@@ -111,21 +111,21 @@ scala-cli Hello.scala -S 3.nightly
111111

112112
For compiling with a specific nightly build you have the full version:
113113

114-
```bash
114+
```bash ignore
115115
scala-cli Hello.scala -S 2.13.9-bin-4505094
116116
```
117117

118118
For setting this inside scala files, use [`using` directives](../guides/introduction/using-directives.md):
119119

120-
```scala compile
120+
```scala
121121
//> using scala 2.nightly
122122
```
123123

124124
```scala compile
125125
//> using scala 3.nightly
126126
```
127127

128-
```scala compile
128+
```scala
129129
//> using scala 2.13.9-bin-4505094
130130
```
131131

0 commit comments

Comments
 (0)