Okay, I found a way to compile it, I just passed random UniqueID as implicit value.
Now I'm getting:
Caused by: java.lang.RuntimeException: Error in job deployment, the FlowProcess for unique id UniqueID(1507929974409003008) isn't available
at scala.sys.package$.error(package.scala:27)
at com.twitter.scalding.RuntimeStats$$anonfun$getFlowProcessForUniqueId$2.apply(Stats.scala:121)
at com.twitter.scalding.RuntimeStats$$anonfun$getFlowProcessForUniqueId$2.apply(Stats.scala:121)
at scala.Option.getOrElse(Option.scala:121)
at com.twitter.scalding.RuntimeStats$.getFlowProcessForUniqueId(Stats.scala:120)
at com.twitter.scalding.Stat$$anon$1.flowProcess$lzycompute(Stats.scala:49)
at com.twitter.scalding.Stat$$anon$1.flowProcess(Stats.scala:49)
at com.twitter.scalding.Stat$$anon$1.incBy(Stats.scala:51)
Tried this in test:
@RunWith(classOf[JUnitRunner])
class MyTraitTest extends FunSuite
with Matchers
with BddDsl{
implicit val flowDef: FlowDef = FlowDef.flowDef().setRunID("1")
val flow: FlowDef = implicitly[FlowDef]
flow.setRunID("1")
test("Geometric intersection of 2 square polygons") {
val input = List(/* some input here */)
Given {
new MySource(input) withSchema List("someField")
} When {
(pipe: Pipe) => pipe.calculateWithCountersInside()(u=UniqueID.getRandom)
} Then {
//verify that stuff
}
}
Tried to u=UniqueID.getRandom change
(pipe: Pipe) => pipe.calculateWithCountersInside()(u=UniqueID.getRandom)
to
(pipe: Pipe) => pipe.calculateWithCountersInside()(u=UniqueID.getIDFor)
or
(pipe: Pipe) => pipe.calculateWithCountersInside()(u=UniqueID.getIDFor(flow))
no luck...