Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.wajam.mry.execution._
import org.scalatest.matchers.ShouldMatchers
import com.wajam.mry.api.Transport
import com.wajam.mry.execution.Operation._
import com.wajam.mry.SlowTest

@RunWith(classOf[JUnitRunner])
class TestProtobufTranslator extends FunSuite with ShouldMatchers {
Expand Down Expand Up @@ -190,7 +191,7 @@ class TestProtobufTranslator extends FunSuite with ShouldMatchers {
assert(results == results2)
}

ignore("transport encode/decode: with (n > 100K), should terminate and yield the proper size") {
test("transport encode/decode: with (n > 100K), should terminate and yield the proper size", SlowTest) {

def randomTransaction(opCount: Int) = {
val t = new Transaction
Expand Down Expand Up @@ -226,14 +227,12 @@ class TestProtobufTranslator extends FunSuite with ShouldMatchers {
}

encodeMs should be <= 10000L // Should actually be around 1500ms
println(encodeMs)
bytes.length should be === 11954748

val decodeMs = timed {
() => { bytes = t.encodeTransaction(trx) }
}

println(decodeMs)
decodeMs should be <= 10000L // Should actually be around 2000ms
}

Expand Down
7 changes: 7 additions & 0 deletions mry-core/src/test/scala/com/wajam/mry/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.wajam

import org.scalatest.Tag

package object mry {
object SlowTest extends Tag("SlowTest")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you put in inside package.scala?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could have put it in test/Tags.scala... But we should anyway but it in some kinds of commons, along with CPUTest, NetworkTest, DiskTest, since those are not specific.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the global package.scala file is a good common for theses. They could still end up in the same file (I like Tags.scala).

And they're not in any commons right now, but might always be extracted one day. commons-tests maybe?

}
14 changes: 12 additions & 2 deletions project/Project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,34 @@ object MryBuild extends Build {
)

lazy val root = Project("mry", file("."))
.configs(Slow)
.configs(IntegrationTest)
.settings(defaultSettings: _*)
.settings(testOptions in IntegrationTest := Seq(Tests.Filter(s => s.contains("Test"))))
.settings(SbtStartScript.startScriptForClassesSettings: _*)
.aggregate(core)

lazy val core = Project("mry-core", file("mry-core"))
.configs(Slow)
.configs(IntegrationTest)
.settings(defaultSettings: _*)
// See http://code.google.com/p/protobuf/issues/detail?id=368
// We don't publish docs because it doesn't work with java generated by protobuf
.settings(publishArtifact in packageDoc := false)
.settings(testOptions in IntegrationTest := Seq(Tests.Filter(s => s.contains("Test"))))
.settings(testOptions in IntegrationTest += Tests.Setup(() => System.setProperty("actors.enableForkJoin", "false")))
.settings(inConfig(Slow)(Defaults.testTasks) : _*)
.settings(
testOptions in Test := Seq(Tests.Argument("-l","SlowTest")),
testOptions in Slow := Seq(Tests.Argument("-n","SlowTest")))
.settings(testOptions in Test += Tests.Setup(() => System.setProperty("actors.enableForkJoin", "false")))
.settings(testOptions in Slow += Tests.Setup(() => System.setProperty("actors.enableForkJoin", "false")))
.settings(testOptions in IntegrationTest += Tests.Setup(() => System.setProperty("actors.enableForkJoin", "false")))
.settings(testOptions in IntegrationTest := Seq(Tests.Filter(s => s.contains("Test"))))
.settings(SbtStartScript.startScriptForClassesSettings: _*)
.settings(parallelExecution in Slow := false)
.settings(parallelExecution in IntegrationTest := false)

lazy val Slow = config("slow") extend Test

import sbtprotobuf.{ProtobufPlugin => PB}

// We keep it as a separate projet, to avoid a dependency on protoc
Expand Down