-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Cross-compile Akka with Scala 3 #29929
Changes from all commits
31224e7
b30b450
155d1d7
9d19992
2fe61c8
0f31adc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.*.swp | ||
.DS_Store | ||
.bloop/ | ||
.bsp/ | ||
.cache | ||
.classpath | ||
.codefellow | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,8 +466,8 @@ class ActorRefSpec extends AkkaSpec(""" | |
def receive = { case name: String => sender() ! context.child(name).isDefined } | ||
}), "parent") | ||
|
||
assert(Await.result((parent ? "child"), timeout.duration) === true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the issue with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nicolasstucki there's no actual issue, this project is just using a scala 2 version of scalatest instead of the scala 3 version: #29929 (comment) |
||
assert(Await.result((parent ? "whatnot"), timeout.duration) === false) | ||
require(Await.result((parent ? "child"), timeout.duration) === true) | ||
require(Await.result((parent ? "whatnot"), timeout.duration) === false) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,13 @@ class TestClassWithDefaultConstructor extends TestSuperclass { | |
class DynamicAccessSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll { | ||
val system = ActorSystem() | ||
|
||
// TODO DOTTY, yes I know it's wrong | ||
implicit val pos: org.scalactic.source.Position = new org.scalactic.source.Position(fileName = "", filePathname = "", lineNumber = 1) | ||
|
||
// TODO DOTTY | ||
protected override def runTest(testName: String, args: org.scalatest.Args): org.scalatest.Status = akka.testkit.ScalatestRunTest.scalatestRunTest(testName, args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
override def run(testName: Option[String], args: org.scalatest.Args): org.scalatest.Status = akka.testkit.ScalatestRunTest.scalatestRun(testName, args) | ||
|
||
"The DynamicAccess of a system" should { | ||
val dynamicAccess = system.asInstanceOf[ExtendedActorSystem].dynamicAccess | ||
|
||
|
@@ -42,7 +49,8 @@ class DynamicAccessSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll | |
case Success(instance) => | ||
fail(s"Expected failure, found $instance") | ||
case Failure(e) => | ||
e shouldBe a[ClassNotFoundException] | ||
// TODO DOTTY | ||
e.getClass shouldBe classOf[ClassNotFoundException] | ||
} | ||
} | ||
|
||
|
@@ -51,7 +59,7 @@ class DynamicAccessSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll | |
instantiateWithDefaultOrStringCtor("akka.actor.TestClassWithDefaultConstructor").get.name shouldBe "default" | ||
instantiateWithDefaultOrStringCtor("akka.actor.foo.NonExistingClass") match { | ||
case Failure(t) => | ||
t shouldBe a[ClassNotFoundException] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
t.getClass shouldBe classOf[ClassNotFoundException] | ||
case Success(instance) => | ||
fail(s"unexpected instance $instance") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a workaround, ScalaTest is usable with Scala 3, but I found a few rough edges.
The implicit position is provided from a macro in Scala 2.X and is not available in Scala 3.
I see that there is some ongoing work to cross-compile ScalaTest (e.g. scalatest/scalatest@e8201d4 ) and I expect that this issue is solved there, maybe @bvenners or @cheeseng can chip in?
Reference issue:
scalatest/scalatest#1950