-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update reference, MiMa previous version and sync TASTy version #22187
Merged
WojciechMazur
merged 5 commits into
scala:main
from
WojciechMazur:build/update-reference-version
Dec 11, 2024
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e8362c0
Update reference version to 3.6.3-RC1
WojciechMazur aa7bf6b
Update mima previous dotty version
WojciechMazur 5ae8f0f
Bump TASTy version, add documentation and runtime test to ensure corr…
WojciechMazur f326b30
Remove never executed test case
WojciechMazur 6bb9559
Fix typo and move TASTy version check to build.sbt so it can be teste…
WojciechMazur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package dotty.tools.tasty | ||
|
||
import org.junit.Assert._ | ||
import org.junit.Test | ||
|
||
import TastyBuffer._ | ||
|
||
// Tests ensuring TASTY version emitted by compiler is matching expected TASTY version | ||
class BuildTastyVersionTest { | ||
|
||
val CurrentTastyVersion = TastyVersion(TastyFormat.MajorVersion, TastyFormat.MinorVersion, TastyFormat.ExperimentalVersion) | ||
|
||
// 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) | ||
.getOrElse(fail(s"Env variable $ExpectedTastyVersionEnvVar not defined")) | ||
.match { | ||
case s"$major.$minor-experimental-$experimental" => TastyVersion(major.toInt, minor.toInt, experimental.toInt) | ||
case s"$major.$minor" if minor.forall(_.isDigit) => TastyVersion(major.toInt, minor.toInt, 0) | ||
case other => fail(s"Invalid TASTY version string: $other") | ||
} | ||
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 | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test actually would be never executed - RELEASEBUILD and NIGHTLYBUILD are set only for the release but not in tests executed as a requirement to start releasing job