2015-06-26 20:06:02 -04:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
context("include an external JAR in SparkContext")
|
|
|
|
|
|
|
|
runScript <- function() {
|
|
|
|
sparkHome <- Sys.getenv("SPARK_HOME")
|
2015-07-05 23:50:02 -04:00
|
|
|
sparkTestJarPath <- "R/lib/SparkR/test_support/sparktestjar_2.10-1.0.jar"
|
|
|
|
jarPath <- paste("--jars", shQuote(file.path(sparkHome, sparkTestJarPath)))
|
2015-12-07 13:38:17 -05:00
|
|
|
scriptPath <- file.path(sparkHome, "R/lib/SparkR/tests/testthat/jarTest.R")
|
2015-06-26 20:06:02 -04:00
|
|
|
submitPath <- file.path(sparkHome, "bin/spark-submit")
|
|
|
|
res <- system2(command = submitPath,
|
|
|
|
args = c(jarPath, scriptPath),
|
|
|
|
stdout = TRUE)
|
|
|
|
tail(res, 2)
|
|
|
|
}
|
|
|
|
|
|
|
|
test_that("sparkJars tag in SparkContext", {
|
|
|
|
testOutput <- runScript()
|
|
|
|
helloTest <- testOutput[1]
|
[SPARK-7714] [SPARKR] SparkR tests should use more specific expectations than expect_true
1. Update the pattern 'expect_true(a == b)' to 'expect_equal(a, b)'.
2. Update the pattern 'expect_true(inherits(a, b))' to 'expect_is(a, b)'.
3. Update the pattern 'expect_true(identical(a, b))' to 'expect_identical(a, b)'.
Author: Sun Rui <rui.sun@intel.com>
Closes #7152 from sun-rui/SPARK-7714 and squashes the following commits:
8ad2440 [Sun Rui] Fix test case errors.
8fe9f0c [Sun Rui] Update the pattern 'expect_true(identical(a, b))' to 'expect_identical(a, b)'.
f1b8005 [Sun Rui] Update the pattern 'expect_true(inherits(a, b))' to 'expect_is(a, b)'.
f631e94 [Sun Rui] Update the pattern 'expect_true(a == b)' to 'expect_equal(a, b)'.
2015-07-01 12:50:12 -04:00
|
|
|
expect_equal(helloTest, "Hello, Dave")
|
2015-06-26 20:06:02 -04:00
|
|
|
basicFunction <- testOutput[2]
|
[SPARK-7714] [SPARKR] SparkR tests should use more specific expectations than expect_true
1. Update the pattern 'expect_true(a == b)' to 'expect_equal(a, b)'.
2. Update the pattern 'expect_true(inherits(a, b))' to 'expect_is(a, b)'.
3. Update the pattern 'expect_true(identical(a, b))' to 'expect_identical(a, b)'.
Author: Sun Rui <rui.sun@intel.com>
Closes #7152 from sun-rui/SPARK-7714 and squashes the following commits:
8ad2440 [Sun Rui] Fix test case errors.
8fe9f0c [Sun Rui] Update the pattern 'expect_true(identical(a, b))' to 'expect_identical(a, b)'.
f1b8005 [Sun Rui] Update the pattern 'expect_true(inherits(a, b))' to 'expect_is(a, b)'.
f631e94 [Sun Rui] Update the pattern 'expect_true(a == b)' to 'expect_equal(a, b)'.
2015-07-01 12:50:12 -04:00
|
|
|
expect_equal(basicFunction, "4")
|
2015-06-26 20:06:02 -04:00
|
|
|
})
|