Skip to content

Commit

Permalink
Updated tests to use Equality in asserts, removed unnecessary string …
Browse files Browse the repository at this point in the history
…interpolation
  • Loading branch information
Anton Kirillov committed Aug 20, 2019
1 parent dc07e09 commit c8b9aaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private[spark] class MesosCoarseGrainedSchedulerBackend(
}
val executable = new File(executorSparkHome, "./bin/spark-class").getPath
val runScript = s"$prefixEnv $executable " +
s"org.apache.spark.executor.CoarseGrainedExecutorBackend"
"org.apache.spark.executor.CoarseGrainedExecutorBackend"

command.setValue(buildExecutorCommand(runScript, taskId, numCores, offer))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MesosSchedulerBackendUtilSuite extends SparkFunSuite {
conf)
val params = containerInfo.getDocker.getParametersList

assert(params.size() == 0)
assert(params.size() === 0)
}

test("ContainerInfo parses docker parameters") {
Expand All @@ -44,13 +44,13 @@ class MesosSchedulerBackendUtilSuite extends SparkFunSuite {
val containerInfo = MesosSchedulerBackendUtil.buildContainerInfo(
conf)
val params = containerInfo.getDocker.getParametersList
assert(params.size() == 3)
assert(params.get(0).getKey == "a")
assert(params.get(0).getValue == "1")
assert(params.get(1).getKey == "b")
assert(params.get(1).getValue == "2")
assert(params.get(2).getKey == "c")
assert(params.get(2).getValue == "3")
assert(params.size() === 3)
assert(params.get(0).getKey === "a")
assert(params.get(0).getValue === "1")
assert(params.get(1).getKey === "b")
assert(params.get(1).getValue === "2")
assert(params.get(2).getKey === "c")
assert(params.get(2).getValue === "3")
}

test("ContainerInfo respects Docker network configuration") {
Expand All @@ -62,10 +62,10 @@ class MesosSchedulerBackendUtilSuite extends SparkFunSuite {

val containerInfo = MesosSchedulerBackendUtil.buildContainerInfo(conf)

assert(containerInfo.getDocker.getNetwork == DockerInfo.Network.USER)
assert(containerInfo.getDocker.getNetwork === DockerInfo.Network.USER)
val params = containerInfo.getDocker.getParametersList
assert(params.size() == 1)
assert(params.get(0).getKey == "net")
assert(params.get(0).getValue == networkName)
assert(params.size() === 1)
assert(params.get(0).getKey === "net")
assert(params.get(0).getValue === networkName)
}
}

0 comments on commit c8b9aaf

Please sign in to comment.