Skip test of legacy compiler if not JDK 17#25452
Skip test of legacy compiler if not JDK 17#25452som-snytt wants to merge 5 commits intoscala:mainfrom
Conversation
|
It should also skip "individual" test files. Edit: tests such as |
| val CompilerVersion = """c([\d\.]+)""".r | ||
| val HasCompilerVersion = """_c([\d\.]+)""".r.unanchored | ||
| val GroupOrdinal = """(\d+)""".r | ||
| val usingCanonicalJava = javaSpecVersion.startsWith("17") |
There was a problem hiding this comment.
Does "canonical" have a specific meaning in context here?
There was a problem hiding this comment.
Thank-you for asking the hard questions. I will answer when I have a canonical answer.
dc22a5a to
4f77381
Compare
|
The failure is coverage blah blah the single test with legacy compiler Aggravated by bootstrapped test not taking a single test name, so I'm running the entire suite per cycle. Maybe I'll figure out why the test rig is broken. |
|
Realized that I have to use JDK 17 to run that test, stop laughing. The bigger joke is that bootstrapped test suite crashed my WSL process. |
|
The error when trying to select tests is |
4f77381 to
c8538b2
Compare
|
Really any test relying on legacy compilation should be excluded from coverage; there aren't many, so I'll look at why more tests don't fail. |
|
I was too "lazy" to check for more tests to exclude, viz, so obviously I wish I'd just implemented my previous suggestion. |
bfee2e3 to
b1c1f76
Compare
b1c1f76 to
c32b611
Compare
SolalPirelli
left a comment
There was a problem hiding this comment.
looks nice now, can we future-proof it?
|
|
||
| object TestConfiguration { | ||
|
|
||
| val usingBaselineJava = javaSpecVersion.startsWith("17") |
There was a problem hiding this comment.
any way we can reuse https://github.com/dotty-staging/dotty/blob/main/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala#L13 to avoid introducing another place that needs changing when we bump the minimum JDK?
| * is a number. These groups are then ordered in ascending order based on | ||
| * the value of `X` and each group is compiled one after the other. | ||
| * A file can request compilation by a legacy compiler via a version suffix: | ||
| * `A_1_c3.2.0.scala` in group 1 is compiled by 3.2.0 under canonical JDK 17. |
There was a problem hiding this comment.
| * `A_1_c3.2.0.scala` in group 1 is compiled by 3.2.0 under canonical JDK 17. | |
| * `A_1_c3.2.0.scala` in group 1 is compiled by 3.2.0 under the default JDK. |
the exact version doesn't really matter here and this comment will become obsolete otherwise, IMHO


Fixes #23090
How much have your relied on LLM-based tools in this contribution?
LLM-free.
That is reminiscent of Ollie, ollie, in come free, which is how we said it.
How was the solution tested?
Manually tested locally under JDK 25, to show that
causes that test to be skipped.
Single test files were not compiled correctly (with the legacy compiler), so also test that this fails without the fix and is skipped with the fix:
Additional notes
Left the unused import of
chainingbecause lacking it results in a tangential rabbit hole:#25451