Skip to content
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

Add Scala 3 in tests #1727

Merged
merged 7 commits into from May 14, 2024
Merged

Add Scala 3 in tests #1727

merged 7 commits into from May 14, 2024

Conversation

ennru
Copy link
Member

@ennru ennru commented Mar 25, 2024

Added Scala 3 even for tests and testing. Scala 3 artefacts were published even before.

@SethTisue
Copy link

SethTisue commented Mar 26, 2024

the CI failure:

[error] -- Error: /home/runner/work/alpakka-kafka/alpakka-kafka/tests/src/test/java/docs/javadsl/TestkitTestcontainersTest.java:47:0 
[error] 47 |
[error]    |^^^^^^^^^
[error]    |')' expected but eof found.

it's reproducible locally with ++3.3.3; tests/Test/compile

the problem isn't fixed in 3.4.1-RC2

it's the Scala 3 compiler that's complaining, not javac. but I tried CompileOrder.JavaThenScala and CompileOrder.ScalaThenJava and that does bypass the error but then compilation doesn't ultimately succeed for other reasons, so we have to make mixed compilation work (or restructure the sources, which we'd rather not have to do)

the problematic line seems to be:

@TestInstance(TestInstance.Lifecycle.PER_CLASS)

if I comment that line out, compilation succeeds. but it's weird that other files in the same directory have the same line

if I change TestInstance.Lifecycle.PER_CLASS to null then Scala compilation succeeds (though then javac complains, as expected)

I don't see anything obviously relevant in https://github.com/scala/scala3/issues (but maybe I missed something)

not sure what to think yet. just writing down what I have so far. need to work on something else now — I'll come back to this but anyone else should feel free to take a look in the meantime

@SethTisue
Copy link

not sure what to think yet

well, I mean, it's clearly a bug in Scala 3's Java parser. it's just a matter of:

  1. creating a self-contained, no-unnecessary-code-or-dependencies reproducer and filing it at https://github.com/scala/scala3/issues
  2. trying to find a workaround we can use for the time being

@SethTisue
Copy link

SethTisue commented Mar 26, 2024

I minimized it and filed

I will still try to find a way to do without the external dependency (on junit-jupiter-api)

as for workarounds, I don't see any wiggle room, can't even think of something to try

@johanandren
Copy link
Member

Now I think it is some actual difference in behavior between Scala 2 and 3:

Logging finished for test [akka.kafka.internal.ConsumerProgressTrackingSpec: should lookup positions from the consumer when assigned] that [Failed(org.mockito.exceptions.misusing.WrongTypeOfReturnValue: 
Integer cannot be returned by position()
position() should return long

@ennru ennru marked this pull request as ready for review May 13, 2024 17:19
@ennru ennru merged commit e92ba0c into akka:main May 14, 2024
10 checks passed
@ennru ennru deleted the ennru-3 branch May 14, 2024 06:40
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 this pull request may close these issues.

None yet

3 participants