aboutsummaryrefslogtreecommitdiff
path: root/R/pkg/inst/tests/test_client.R
diff options
context:
space:
mode:
authorHolden Karau <holden@pigscanfly.ca>2015-06-24 11:55:20 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-06-24 11:55:20 -0700
commit43e66192f45a23f7232116e9f664158862df5015 (patch)
tree2fd464e8c2c997397a3a05abb0bf0f7d62031c33 /R/pkg/inst/tests/test_client.R
parent1173483f3f465a4c63246e83d0aaa2af521395f5 (diff)
downloadspark-43e66192f45a23f7232116e9f664158862df5015.tar.gz
spark-43e66192f45a23f7232116e9f664158862df5015.tar.bz2
spark-43e66192f45a23f7232116e9f664158862df5015.zip
[SPARK-8506] Add pakages to R context created through init.
Author: Holden Karau <holden@pigscanfly.ca> Closes #6928 from holdenk/SPARK-8506-sparkr-does-not-provide-an-easy-way-to-depend-on-spark-packages-when-performing-init-from-inside-of-r and squashes the following commits: b60dd63 [Holden Karau] Add an example with the spark-csv package fa8bc92 [Holden Karau] typo: sparm -> spark 865a90c [Holden Karau] strip spaces for comparision c7a4471 [Holden Karau] Add some documentation c1a9233 [Holden Karau] refactor for testing c818556 [Holden Karau] Add pakages to R
Diffstat (limited to 'R/pkg/inst/tests/test_client.R')
-rw-r--r--R/pkg/inst/tests/test_client.R32
1 files changed, 32 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/test_client.R b/R/pkg/inst/tests/test_client.R
new file mode 100644
index 0000000000..30b05c1a2a
--- /dev/null
+++ b/R/pkg/inst/tests/test_client.R
@@ -0,0 +1,32 @@
+#
+# 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("functions in client.R")
+
+test_that("adding spark-testing-base as a package works", {
+ args <- generateSparkSubmitArgs("", "", "", "",
+ "holdenk:spark-testing-base:1.3.0_0.0.5")
+ expect_equal(gsub("[[:space:]]", "", args),
+ gsub("[[:space:]]", "",
+ "--packages holdenk:spark-testing-base:1.3.0_0.0.5"))
+})
+
+test_that("no package specified doesn't add packages flag", {
+ args <- generateSparkSubmitArgs("", "", "", "", "")
+ expect_equal(gsub("[[:space:]]", "", args),
+ "")
+})