Skip to content

Relax check file match with stack trace#22389

Open
som-snytt wants to merge 4 commits intoscala:mainfrom
som-snytt:tweak/relax-check
Open

Relax check file match with stack trace#22389
som-snytt wants to merge 4 commits intoscala:mainfrom
som-snytt:tweak/relax-check

Conversation

@som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jan 16, 2025

A handful of tests under neg-macros include a stack trace in the check file, which makes them sensitive to irrelevant changes in distant source code.

This commit conservatively ignores line numbers in stack trace output when doing line text comparisons of test output.

A future improvement would be for suppressAllOutput to be a filter that can suppress output or normalize it on a per-need basis.

The test group name is corrected to negMacros.

As shown at 3cff3be

// //> using options -language:experimental.modularity -source future

did not previously turn off the options, as it did for scala-cli. It's not immediately obvious whether it's a bug that the test requires the objects (which are removed for other tests in that commit).

Now, //> must be at the beginning of the line. (There may be other ways the test syntax could be aligned with CLI directives.)

@som-snytt som-snytt marked this pull request as ready for review January 17, 2025 16:45
@Gedochao Gedochao requested a review from hamzaremmal January 30, 2025 07:51
@som-snytt som-snytt added the area:vulpix Issues tied with Vulpix, the internal compiler testing framework. label Feb 26, 2025
@som-snytt som-snytt force-pushed the tweak/relax-check branch from 66cb2b1 to e6fa472 Compare May 1, 2025 00:46
@som-snytt som-snytt marked this pull request as draft September 3, 2025 14:58
@som-snytt som-snytt marked this pull request as ready for review November 19, 2025 14:10
Copy link
Contributor

@SolalPirelli SolalPirelli left a comment

Choose a reason for hiding this comment

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

If the specific goal is macro-related code, should this be enabled only for those? IMHO ignoring all line numbers is risky and might hide unrelated bugs...

@som-snytt
Copy link
Contributor Author

som-snytt commented Feb 17, 2026

In my experience, testing stack traces by default is noise. The tweak only relaxes the source line, which changes with arbitrary edits.

If I want to test a stack trace or positions, I would do that with a predicate that explains what property of the stack elements is being enforced.

The current situation is poor isolation of tests.

By contrast, a tweak to tree positions will annoyingly but helpfully require updates to tests.

(Edit: similarly for the inlined positions shown for errors, which are a feature.)

I think the fix for the directive in tests may have got in already. (Edit: no, that's a different fix!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:vulpix Issues tied with Vulpix, the internal compiler testing framework.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments