Skip to content

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Sep 25, 2025

Add noise suppression. Refactor to modern facilities.

Why was the ticket worth tackling?

It didn't have a ticket, but there was confusion on a ticket about the noisy output. That is a waste of time, in a context where the build is in flux.

I wanted to ensure that my recent fix to how lines are counted by the test rig didn't break something. (There was just one semantic merge conflict, for a check file.)

How I fixed it

I finally noticed that the local test run correctly summarizes no failures, even though the individual test echoed its failure state.

[info] Test run dotty.tools.vulpix.VulpixUnitTests finished: 0 failed, 0 ignored, 19 total, 23.642s
[info] Passed: Total 19, Failed 0, Errors 0, Passed 19

Then I noticed that the rig already has a flag for noise suppression, so I added that incrementally.

Since the unit test file is not large, it was expedient to refactor it to look more modern, but without other behavior changes.

Why is this PR worth reviewing?

It improves readability of the test rig's unit test, but avoids futzing with any operational semantics such as threading.

Removing the noisy output helps when scrolling through copious C.I. output, where it looks like an error.

What's the worse that could happen?

The build breaks in subtle ways.

@hamzaremmal
Copy link
Member

Thanks for taking care of this @som-snytt. One less item out of my TODO list!

@som-snytt
Copy link
Contributor Author

The longish thread where we were confused.

#24068 (comment)

@som-snytt
Copy link
Contributor Author

@hamzaremmal I'm glad to contribute when I can (without making extra work); if there is an actual todo list, let me know!

@som-snytt som-snytt marked this pull request as ready for review September 25, 2025 22:18
@hamzaremmal
Copy link
Member

@hamzaremmal I'm glad to contribute when I can (without making extra work); if there is an actual todo list, let me know!

YES, I have a long list of things that should be done. Some are urgent and some are not. It doesn't look like a list but it is known internally as my post-it screen.


PS: I will review this by Sunday. I'm focusing on studies today.

@hamzaremmal hamzaremmal self-requested a review September 26, 2025 08:51
@hamzaremmal hamzaremmal self-assigned this Sep 26, 2025
*/
def expectFailure: CompilationTest =
new CompilationTest(targets, times, shouldDelete, threadLimit, true, shouldSuppressOutput)
new CompilationTest(targets, times, shouldDelete, threadLimit, shouldFail = true, shouldSuppressOutput)
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 not a fan of mixing named parameters with unnamed parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Boolean literals always get a name. Scala 2 has -Wunnamed-boolean-literal.

@hamzaremmal hamzaremmal merged commit 9be627d into scala:main Sep 29, 2025
50 checks passed

import scala.concurrent.duration._
import scala.util.control.NonFatal
import org.junit.{Test as test, AfterClass as tearDown}
Copy link
Member

Choose a reason for hiding this comment

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

I find that confusing. Aliases here makes the code harder to follow: each time someone sees @test or tearDown, they’ll need to check the import to realize these are actually JUnit’s @Test and @AfterClass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I borrowed that idiom from bishabosha, I think. I just saw it recently and fell in love. However, I am not wedded to it (at present).

@som-snytt som-snytt deleted the test/vulpix-test branch September 29, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants