Skip to content
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

fix: adjust tests for 3.2.0-NIGHTLY #3687

Merged
merged 1 commit into from
Mar 10, 2022
Merged

Conversation

dos65
Copy link
Member

@dos65 dos65 commented Mar 8, 2022

Also, extended the compat in tests cases.
Now it's possible to specify matching version not only as starts with
but as greater or equal.

For example:

check(
  "input ... ",
  "default expected ...",
  compat = Map(
   ">=3.1.0" -> "expected for version gte than 3.1.0",
   "3" -> "any otherversion that starts from 3"
  )
)

@dos65 dos65 force-pushed the scala_3.2.0-nightly branch from 1807223 to 7cc949d Compare March 8, 2022 17:20
Comment on lines +75 to +76
def undoBacktick(label: String): String =
label.stripPrefix("`").stripSuffix("`")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming these are due to my changes in scala/scala3#14594. Is this how we want to handle this though? In these cases aren't we stripping them here and then adding them back later? Would it be better to instead check when we are about to add them and if they exist already, then don't add them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckipp01 I agree that it isn't perfect but they anyway should be removed from completion label

Copy link
Member

@tanishiking tanishiking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for @ckipp01 's comment, it's LGTM from my side (I left one comment).

}
.getOrElse((None, None))
val date = parts.lift(5).map(_.toInt)
Version(major, minor, patch, rc, milestone, date)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -81,7 +81,7 @@ class HoverScala3TypeSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.1.3-RC1" ->
">=3.1.3-RC1-bin-20220301-fae7c09-NIGHTLY" ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we say >3.1.3-RC1 here? (this is not a strong opinion. If you prefer this way, go ahead 👍 )

  • If we write >3.1.3-RC1, the nightly releases of 3.1.3-RC1 before 20220301 will fail, but do we test against older Scala3 nightly release?
  • I feel it's too specific
  • If we can write >3.1.3-RC1, we can omit nightlyDate field from Version case class, and keep it simple :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanishiking Initially I wanted to use just > but then realized that the actual usage of this might be gte only. Some change happens in specific version so you add a new compat case that should be used from this version and next ones.
I agree that >= is more verbose than > but I think at least it's more clear.

If we write >3.1.3-RC1, the nightly releases of 3.1.3-RC1 before 20220301 will fail, but do we test against older Scala3 nightly release?

We have a ci workflow that tests and backpublishes support of new scala3-nightly versions for the latest Metals version.
Being too specific with versions will help to stabilize this workflow as currently it often fails.

Copy link
Member

@tanishiking tanishiking Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed explanation!

We have a ci workflow that tests and backpublishes support of new scala3-nightly versions for the latest Metals version.
Being too specific with versions will help to stabilize this workflow as currently it often fails.

I'm convinced that being specific with versions would be better. Now, it's LGTM from my part.

tests/mtest/src/main/scala/tests/Compat.scala Outdated Show resolved Hide resolved
.map { case (v, a) =>
(SemVer.Version.fromString(v.stripPrefix(">=")), a)
}
.filter({ case (v, _) => parsed >= v })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.filter({ case (v, _) => parsed >= v })
.filter { case (v, _) => parsed >= v }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for suggestions! applied all of them

tests/mtest/src/main/scala/tests/Compat.scala Outdated Show resolved Hide resolved
@dos65 dos65 force-pushed the scala_3.2.0-nightly branch from eacab93 to dca18d4 Compare March 9, 2022 18:37
Also, exnteded the `compat` inn tests cases.
Now it's possible to specify matching version not only as starts with
but as greater or equal.

For example:
```
check(
  "input ... ",
  "default expected ...",
  compat = Map(
   ">=3.1.0" -> "expected for version gte than 3.1.0",
   "3" -> "any otherversion that starts from 3"
  )
)
```

Co-authored-by: Kamil Podsiadło <[email protected]>
@dos65 dos65 force-pushed the scala_3.2.0-nightly branch from dca18d4 to 1cdaa25 Compare March 9, 2022 18:50
@dos65 dos65 merged commit 864f16a into scalameta:main Mar 10, 2022
dos65 added a commit that referenced this pull request Mar 10, 2022
Also, exnteded the `compat` inn tests cases.
Now it's possible to specify matching version not only as starts with
but as greater or equal.

For example:
```
check(
  "input ... ",
  "default expected ...",
  compat = Map(
   ">=3.1.0" -> "expected for version gte than 3.1.0",
   "3" -> "any otherversion that starts from 3"
  )
)
```

Co-authored-by: Kamil Podsiadło <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants