Skip to content
Merged
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
10 changes: 9 additions & 1 deletion scalding-core/src/main/scala/com/twitter/scalding/JobTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class JobTest(cons: (Args) => Job) {
private var sourceMap: (Source) => Option[Buffer[Tuple]] = { _ => None }
private var sinkSet = Set[Source]()
private var fileSet = Set[String]()
private var validateJob = false

def arg(inArg: String, value: List[String]) = {
argsMap += inArg -> value
Expand Down Expand Up @@ -164,6 +165,11 @@ class JobTest(cons: (Args) => Job) {
// This SITS is unfortunately needed to get around Specs
def finish: Unit = { () }

def validate(v: Boolean) = {
validateJob = v
this
}

// Registers test files, initializes the global mode, and creates a job.
private def initJob(useHadoop: Boolean, job: Option[JobConf] = None): Job = {
// Create a global mode to use for testing.
Expand Down Expand Up @@ -198,7 +204,9 @@ class JobTest(cons: (Args) => Job) {
System.setProperty("cascading.planner.stats.path", "target/test/cascading/traceplan/" + job.name + "/stats")
}

job.validate
if (validateJob) {
job.validate
}
job.run
// Make sure to clean the state:
job.clear
Expand Down