Skip to content

Commit

Permalink
Remove never executed test case
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Dec 11, 2024
1 parent 5ae8f0f commit f326b30
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
1 change: 0 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,6 @@ object Build {
versionScheme := Some("semver-spec"),
Test / envVars ++= Map(
"EXPECTED_TASTY_VERSION" -> expectedTastyVersion,
"BASE_VERSION" -> baseVersion
),
if (mode == Bootstrapped) Def.settings(
commonMiMaSettings,
Expand Down
39 changes: 0 additions & 39 deletions tasty/test/dotty/tools/tasty/BuildTastyVersionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class BuildTastyVersionTest {

// Needs to be defined in build Test/envVars
val ExpectedTastyVersionEnvVar = "EXPECTED_TASTY_VERSION"
val BaseVersionEnvVar = "BASE_VERSION"

@Test def testBuildTastyVersion(): Unit = {
val expectedVersion = sys.env.get(ExpectedTastyVersionEnvVar)
Expand All @@ -24,42 +23,4 @@ class BuildTastyVersionTest {
}
assertEquals(CurrentTastyVersion, expectedVersion)
}

// Tested only in nightly / release builds
// Protects from publishing artifacts with incorrect TASTY version
@Test def testReleasedTastyVersion(): Unit = {
lazy val (minor, patch, isRC) = sys.env.get(BaseVersionEnvVar)
.getOrElse(fail(s"Env variable $BaseVersionEnvVar not defined"))
.match {
case s"3.$minor.$patch-${_}" => (minor.toInt, patch.toInt, true)
case s"3.$minor.$patch" => (minor.toInt, patch.toInt, false)
case other => fail(s"Invalid Scala base version string: $other")
}

if sys.env.get("NIGHTLYBUILD").contains("yes") then {
assertTrue(
"TASTY needs to be experimental in nightly builds",
CurrentTastyVersion.isExperimental
)
assertEquals(
CurrentTastyVersion.minor,
if patch == 0 then minor else (minor + 1)
)
} else if sys.env.get("RELEASEBUILD").contains("yes") then {
assertEquals(
"Minor versions of TASTY vesion and Scala version should match in stable release",
CurrentTastyVersion.minor, minor
)
if isRC then
assertEquals(
"TASTy should be experimental when releasing a new minor version RC",
CurrentTastyVersion.isExperimental, patch == 0
)
else
assertFalse(
"Stable version cannot use experimental TASTY",
CurrentTastyVersion.isExperimental
)
}
}
}

0 comments on commit f326b30

Please sign in to comment.