Skip to content

Commit

Permalink
Merge pull request akka#16185 from spray/w/faster-PR-validation
Browse files Browse the repository at this point in the history
optimize pull request validation for release-2.3-dev branch
  • Loading branch information
bantonsson committed Nov 5, 2014
2 parents 77fee04 + c6267fd commit ec96029
Show file tree
Hide file tree
Showing 30 changed files with 29 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.lang.reflect.Modifier
import org.scalatest.Matchers
import org.scalatest.WordSpec

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class DslConsistencySpec extends WordSpec with Matchers {

val sFlowClass = classOf[akka.stream.scaladsl.Flow[_, _]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.lang.reflect.Method
import org.scalatest.Matchers
import org.scalatest.WordSpec

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class DslFactoriesConsistencySpec extends WordSpec with Matchers {

// configuration //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ object ActorPublisherSpec {

}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class ActorPublisherSpec extends AkkaSpec with ImplicitSender {
import akka.stream.actor.ActorPublisherSpec._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ object ActorSubscriberSpec {
}
}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class ActorSubscriberSpec extends AkkaSpec with ImplicitSender {
import ActorSubscriberMessage._
import ActorSubscriberSpec._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import akka.stream.testkit.StreamTestKit
import akka.testkit.TestProbe
import org.reactivestreams.{ Subscriber, Subscription }

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class SynchronousPublisherFromIterableSpec extends AkkaSpec {

"A SynchronousPublisherFromIterable" must {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ class FlowCollectSpec extends AkkaSpec with ScriptedTest {
"A Collect" must {

"collect" in {
val range = 1 to 50
def script = Script(range map { _
def script = Script(TestConfig.RandomTestRange map { _
val x = random.nextInt(0, 10000)
Seq(x) -> (if ((x & 1) == 0) Seq((x * x).toString) else Seq.empty[String])
}: _*)
range foreach (_ runScript(script, settings)(_.collect { case x if x % 2 == 0 (x * x).toString }))
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.collect { case x if x % 2 == 0 (x * x).toString }))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import akka.testkit.TestProbe
import akka.stream.testkit.AkkaSpec
import akka.stream.FlowMaterializer

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowDispatcherSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class FlowDropSpec extends AkkaSpec with ScriptedTest {
"A Drop" must {

"drop" in {
def script(d: Int) = Script((1 to 50) map { n Seq(n) -> (if (n <= d) Nil else Seq(n)) }: _*)
(1 to 50) foreach { _
def script(d: Int) = Script(TestConfig.RandomTestRange map { n Seq(n) -> (if (n <= d) Nil else Seq(n)) }: _*)
TestConfig.RandomTestRange foreach { _
val d = Math.min(Math.max(random.nextInt(-10, 60), 0), 50)
runScript(script(d), settings)(_.drop(d))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import akka.stream.FlowMaterializer
import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.StreamTestKit

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowDropWithinSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class FlowFilterSpec extends AkkaSpec with ScriptedTest {
"A Filter" must {

"filter" in {
def script = Script((1 to 50) map { _ val x = random.nextInt(); Seq(x) -> (if ((x & 1) == 0) Seq(x) else Seq()) }: _*)
(1 to 50) foreach (_ runScript(script, settings)(_.filter(_ % 2 == 0)))
def script = Script(TestConfig.RandomTestRange map { _ val x = random.nextInt(); Seq(x) -> (if ((x & 1) == 0) Seq(x) else Seq()) }: _*)
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.filter(_ % 2 == 0)))
}

"not blow up with high request counts" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import akka.stream.MaterializerSettings
import akka.stream.testkit._
import org.reactivestreams.Publisher

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowGroupBySpec extends AkkaSpec {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class FlowGroupedSpec extends AkkaSpec with ScriptedTest {
"A Grouped" must {

"group evenly" in {
def script = Script((1 to 20) map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }: _*)
(1 to 30) foreach (_ runScript(script, settings)(_.grouped(3)))
def script = Script(TestConfig.RandomTestRange map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }: _*)
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.grouped(3)))
}

"group with rest" in {
def script = Script(((1 to 20).map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }
def script = Script((TestConfig.RandomTestRange.map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }
:+ { val x = random.nextInt(); Seq(x) -> Seq(immutable.Seq(x)) }): _*)
(1 to 30) foreach (_ runScript(script, settings)(_.grouped(3)))
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.grouped(3)))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.ScriptedTest
import akka.stream.testkit.StreamTestKit

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowGroupedWithinSpec extends AkkaSpec with ScriptedTest {

val settings = MaterializerSettings(system)
Expand Down Expand Up @@ -126,14 +125,14 @@ class FlowGroupedWithinSpec extends AkkaSpec with ScriptedTest {
}

"group evenly" in {
def script = Script((1 to 20) map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }: _*)
(1 to 30) foreach (_ runScript(script, settings)(_.groupedWithin(3, 10.minutes)))
def script = Script(TestConfig.RandomTestRange map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }: _*)
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.groupedWithin(3, 10.minutes)))
}

"group with rest" in {
def script = Script(((1 to 20).map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }
def script = Script((TestConfig.RandomTestRange.map { _ val x, y, z = random.nextInt(); Seq(x, y, z) -> Seq(immutable.Seq(x, y, z)) }
:+ { val x = random.nextInt(); Seq(x) -> Seq(immutable.Seq(x)) }): _*)
(1 to 30) foreach (_ runScript(script, settings)(_.groupedWithin(3, 10.minutes)))
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.groupedWithin(3, 10.minutes)))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import akka.stream.MaterializerSettings
import akka.stream.testkit.{ AkkaSpec, StreamTestKit }
import akka.stream.testkit.StreamTestKit.{ OnComplete, OnError, OnNext }

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowIterableSpec extends AkkaSpec {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import akka.stream.testkit.StreamTestKit.OnComplete
import akka.stream.testkit.StreamTestKit.OnError
import akka.stream.testkit.StreamTestKit.OnNext

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowIteratorSpec extends AkkaSpec {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import akka.stream.testkit.StreamTestKit
import akka.testkit.TestLatch
import akka.testkit.TestProbe

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowMapAsyncSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FlowMapConcatSpec extends AkkaSpec with ScriptedTest {
Seq(3) -> Seq(3, 3, 3),
Seq(2) -> Seq(2, 2),
Seq(1) -> Seq(1))
(1 to 100) foreach (_ runScript(script, settings)(_.mapConcat(x (1 to x) map (_ x))))
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.mapConcat(x (1 to x) map (_ x))))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class FlowMapSpec extends AkkaSpec with ScriptedTest {
"A Map" must {

"map" in {
def script = Script((1 to 50) map { _ val x = random.nextInt(); Seq(x) -> Seq(x.toString) }: _*)
(1 to 50) foreach (_ runScript(script, settings)(_.map(_.toString)))
def script = Script(TestConfig.RandomTestRange map { _ val x = random.nextInt(); Seq(x) -> Seq(x.toString) }: _*)
TestConfig.RandomTestRange foreach (_ runScript(script, settings)(_.map(_.toString)))
}

"not blow up with high request counts" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.ScriptedTest
import akka.testkit.TestProbe

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowOnCompleteSpec extends AkkaSpec with ScriptedTest {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ object FlowSpec {
}
}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowSpec extends AkkaSpec(ConfigFactory.parseString("akka.actor.debug.receive=off\nakka.loglevel=INFO")) {
import FlowSpec._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.StreamTestKit
import org.reactivestreams.Publisher

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowSplitWhenSpec extends AkkaSpec {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class FlowTakeSpec extends AkkaSpec with ScriptedTest {
"A Take" must {

"take" in {
def script(d: Int) = Script((1 to 50) map { n Seq(n) -> (if (n > d) Nil else Seq(n)) }: _*)
(1 to 50) foreach { _
def script(d: Int) = Script(TestConfig.RandomTestRange map { n Seq(n) -> (if (n > d) Nil else Seq(n)) }: _*)
TestConfig.RandomTestRange foreach { _
val d = Math.min(Math.max(random.nextInt(-10, 60), 0), 50)
runScript(script(d), settings)(_.take(d))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import akka.stream.FlowMaterializer
import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.StreamTestKit

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowTakeWithinSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import akka.stream.TimerTransformer

import akka.stream.testkit.{ AkkaSpec, StreamTestKit }

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowTimerTransformerSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ object FlowTransformRecoverSpec {
}
}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowTransformRecoverSpec extends AkkaSpec {
import FlowTransformRecoverSpec._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import akka.stream.testkit.{ AkkaSpec, StreamTestKit }
import akka.testkit.{ EventFilter, TestProbe }
import com.typesafe.config.ConfigFactory

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class FlowTransformSpec extends AkkaSpec(ConfigFactory.parseString("akka.actor.debug.receive=off\nakka.loglevel=INFO")) {

val settings = MaterializerSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ object ImplicitFlowMaterializerSpec {
}
}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class ImplicitFlowMaterializerSpec extends AkkaSpec with ImplicitSender {
import ImplicitFlowMaterializerSpec._

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/

package akka.stream.scaladsl

object TestConfig {
val numberOfTestsToRun = System.getProperty("akka.stream.test.numberOfRandomizedTests", "10").toInt
val RandomTestRange = 1 to numberOfTestsToRun
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import akka.stream.FlowMaterializer
import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.StreamTestKit

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class TickSourceSpec extends AkkaSpec {

implicit val materializer = FlowMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ object TimerTransformerSpec {
}
}

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class TimerTransformerSpec extends AkkaSpec {
import TimerTransformerSpec._

Expand Down

0 comments on commit ec96029

Please sign in to comment.