Skip to content

Commit

Permalink
Merge pull request #1845 from fwbrasil/jobtestlocal
Browse files Browse the repository at this point in the history
 fix JobTest to use local mode
  • Loading branch information
dieu committed Mar 14, 2018
2 parents d36a388 + c3119fb commit c944a6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import cascading.tuple.Tuple
import cascading.tuple.TupleEntry
import cascading.stats.CascadingStats
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.mapred.JobConf

import scala.util.Try

Expand Down Expand Up @@ -187,7 +188,7 @@ class JobTest(cons: (Args) => Job) {
// Create a global mode to use for testing.
val testMode: TestMode =
if (useHadoop) {
val conf = optConfig.getOrElse(new Configuration)
val conf = optConfig.getOrElse(new JobConf)
// Set the polling to a lower value to speed up tests:
conf.set("jobclient.completion.poll.interval", "100")
conf.set("cascading.flow.job.pollinginterval", "5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ class JobTestTest extends WordSpec with Matchers {
runJobTest()
} should have message (s"Failed to create tap for: ${requiredSource}, with error: requirement failed: " + TestTapFactory.sourceNotFoundError.format(requiredSource))
}
"use local mode by default" in {
JobTest(new SimpleTestJob(_)).getTestMode(true, None) match {
case m: HadoopTest => m.jobConf.get("mapreduce.framework.name") shouldBe "local"
}
}
}
}

0 comments on commit c944a6e

Please sign in to comment.