Skip to content

2.13.17: Metals test failure in community build (HoverPlaintextSuite) #903

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

Closed
SethTisue opened this issue Apr 17, 2025 · 3 comments · Fixed by scalameta/metals#7426
Closed
Milestone

Comments

@SethTisue
Copy link
Member

SethTisue commented Apr 17, 2025

as seen at https://scala-ci.typesafe.com/job/scala-2.13.x-jdk17-integrate-community-build/2616/artifact/logs/metals-build.log

responsible PR appears to be scala/scala#11040

@kasiaMarek perhaps the test could be made less fragile...?

[metals] [info] tests.hover.HoverPlaintextSuite.fold-plaintext_2.13.17-bin-c392ee5 started
[metals] [error] ==> X tests.hover.HoverPlaintextSuite.fold-plaintext_2.13.17-bin-c392ee5  0.087s munit.ComparisonFailException: tests/cross/src/test/scala/tests/hover/HoverPlaintextSuite.scala:38
[metals] [error] 37:
[metals] [error] 38:  check(
[metals] [error] 39:    "fold-plaintext",
[metals] [error] diff assertion failed
[metals] [error] => Obtained
[metals] [error] Expression type:
[metals] [error] String
[metals] [error] 
[metals] [error] Symbol signature:
[metals] [error] final def fold[B](ifEmpty: => B)(f: Int => B): B
[metals] [error] 
[metals] [error] Returns the result of applying f to this [[scala.Option]]'s
[metals] [error]  value if the [[scala.Option]] is nonempty.  Otherwise, evaluates
[metals] [error]  expression ifEmpty.
[metals] [error] 
[metals] [error] This is equivalent to:
[metals] [error] 
[metals] [error] {{{
[metals] [error] option match {
[metals] [error]   case Some(x) => f(x)
[metals] [error]   case None    => ifEmpty
[metals] [error] }
[metals] [error] }}}
[metals] [error] 
[metals] [error] This is also equivalent to:
[metals] [error] 
[metals] [error] {{{
[metals] [error] option.map(f).getOrElse(ifEmpty)
[metals] [error] }}}
[metals] [error] 
[metals] [error] @param ifEmpty: the expression to evaluate if empty.
[metals] [error] @param f: the function to apply if nonempty.
[metals] [error] => Diff (- expected, + obtained)
[metals] [error]  {{{
[metals] [error] -option map f getOrElse ifEmpty
[metals] [error] +option.map(f).getOrElse(ifEmpty)
[metals] [error]  }}}
@SethTisue SethTisue added this to the 2.13.17 milestone Apr 17, 2025
@SethTisue SethTisue changed the title 2.13.17: Metals test failure in community build 2.13.17: Metals test failure in community build (HoverPlaintextSuite) Apr 17, 2025
@lrytz
Copy link
Member

lrytz commented Apr 25, 2025

Ping @kasiaMarek -- the test (https://github.com/scalameta/metals/blob/main/tests/cross/src/test/scala/tests/hover/HoverPlaintextSuite.scala) compares the Scaladoc from the standard library, which can change.

Could the test be changed so that the definitions are part of the test? Or is there a reason to test definitions from the standard library?

@kasiaMarek
Copy link
Member

Could the test be changed so that the definitions are part of the test?

I think the main point of this suite was to test how Scaladoc is printed. So definitions can be a part of the test. I'll add a fix. (Thanks for pinging me by the way, this slipped my mind).

@lrytz
Copy link
Member

lrytz commented Apr 28, 2025

Thanks!

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 a pull request may close this issue.

3 participants