Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cleaner, quieter test rig tests #24073

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

Merged
hamzaremmal merged 1 commit into scala:main from som-snytt:test/vulpix-test
Sep 29, 2025
Merged

Conversation

Copy link
Contributor

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

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.

He-Pin reacted with heart emoji nox213 reacted with rocket emoji
Copy link
Member

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

Copy link
Contributor Author

The longish thread where we were confused.

#24068 (comment)

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!

He-Pin and hamzaremmal reacted with heart emoji

@som-snytt som-snytt marked this pull request as ready for review September 25, 2025 22:18
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.

som-snytt reacted with rocket emoji

*/
def expectFailure: CompilationTest =
new CompilationTest(targets, times, shouldDelete, threadLimit, true, shouldSuppressOutput)
new CompilationTest(targets, times, shouldDelete, threadLimit, shouldFail =true, shouldSuppressOutput)
Copy link
Member

@hamzaremmal hamzaremmal Sep 29, 2025

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

@som-snytt som-snytt Sep 29, 2025

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

@som-snytt som-snytt Sep 29, 2025

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
Reviewers

@mbovel mbovel mbovel left review comments

@hamzaremmal hamzaremmal hamzaremmal approved these changes

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /