Akka Stream TCK tests on Scala 3.0 (#30360)

Co-authored-by: Renato Cavalcanti <renato@cavalcanti.be>
This commit is contained in:
Johan Andrén 2021-07-12 19:22:58 +02:00 committed by GitHub
parent 8d5a4604f9
commit 33e263e731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View file

@ -38,7 +38,7 @@ jobs:
- stage: scala3 - stage: scala3
name: scala3 name: scala3
# separate job since only a few modules compile with Scala 3 yet # separate job since only a few modules compile with Scala 3 yet
script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-typed/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-typed/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile akka-stream-tests-tck/test
stages: stages:
- name: whitesource - name: whitesource

View file

@ -150,7 +150,7 @@ object StreamTestKit {
builder.append(s"[label=shouldPush, color=red, dir=back];") builder.append(s"[label=shouldPush, color=red, dir=back];")
case ConnectionSnapshot.Closed => case ConnectionSnapshot.Closed =>
builder.append("[style=dotted, label=closed, dir=both];") builder.append("[style=dotted, label=closed, dir=both];")
case _ => case null =>
} }
builder.append("\n") builder.append("\n")
} }

View file

@ -451,28 +451,28 @@ trait GraphInterpreterSpecKit extends StreamSpec {
override def step(): Unit = interpreter.execute(eventLimit = if (!chasing) 1 else 2) override def step(): Unit = interpreter.execute(eventLimit = if (!chasing) 1 else 2)
class UpstreamPortProbe[T] extends UpstreamProbe[T]("upstreamPort") { class UpstreamPortProbe[T] extends UpstreamProbe[T]("upstreamPort") {
def isAvailable: Boolean = isAvailable(out) def isAvailable: Boolean = isAvailable(this.out)
def isClosed: Boolean = isClosed(out) def isClosed: Boolean = isClosed(this.out)
def push(elem: T): Unit = push(out, elem) def push(elem: T): Unit = push(this.out, elem)
def complete(): Unit = complete(out) def complete(): Unit = complete(this.out)
def fail(ex: Throwable): Unit = fail(out, ex) def fail(ex: Throwable): Unit = fail(this.out, ex)
} }
class DownstreamPortProbe[T] extends DownstreamProbe[T]("upstreamPort") { class DownstreamPortProbe[T] extends DownstreamProbe[T]("upstreamPort") {
def isAvailable: Boolean = isAvailable(in) def isAvailable: Boolean = isAvailable(this.in)
def hasBeenPulled: Boolean = hasBeenPulled(in) def hasBeenPulled: Boolean = hasBeenPulled(this.in)
def isClosed: Boolean = isClosed(in) def isClosed: Boolean = isClosed(this.in)
def pull(): Unit = pull(in) def pull(): Unit = pull(this.in)
def cancel(): Unit = cancel(in) def cancel(): Unit = cancel(this.in)
def grab(): T = grab(in) def grab(): T = grab(this.in)
setHandler(in, new InHandler { setHandler(this.in, new InHandler {
// Modified onPush that does not grab() automatically the element. This accesses some internals. // Modified onPush that does not grab() automatically the element. This accesses some internals.
override def onPush(): Unit = { override def onPush(): Unit = {
val internalEvent = portToConn(in.id).slot val internalEvent = portToConn(DownstreamPortProbe.this.in.id).slot
internalEvent match { internalEvent match {
case Failed(_, elem) => lastEvent += OnNext(DownstreamPortProbe.this, elem) case Failed(_, elem) => lastEvent += OnNext(DownstreamPortProbe.this, elem)