From 64141d20049098c51ac7dd99c38b840b25ca073a Mon Sep 17 00:00:00 2001 From: hyukjinkwon Date: Wed, 25 May 2016 22:28:54 +0900 Subject: [PATCH] Skip Windows test on Linux and repleace jars to list --- R/pkg/inst/tests/testthat/test_Windows.R | 3 +++ R/pkg/inst/tests/testthat/test_context.R | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/pkg/inst/tests/testthat/test_Windows.R b/R/pkg/inst/tests/testthat/test_Windows.R index a6a24345552f9..fe4f7bd9030a5 100644 --- a/R/pkg/inst/tests/testthat/test_Windows.R +++ b/R/pkg/inst/tests/testthat/test_Windows.R @@ -17,6 +17,9 @@ context("test the support SparkR on Windows") test_that("sparkJars tag in SparkContext", { + if (.Platform$OS.type != "windows") { + skip("This test is only for Windows, skipped") + } testOutput <- determineLauncher("ECHO" ,"/a/b/c" , capture = TRUE) abcPath <- testOutput[1] expect_equal(abcPath, "\\a\\b\\c") diff --git a/R/pkg/inst/tests/testthat/test_context.R b/R/pkg/inst/tests/testthat/test_context.R index 80ae9f678bbd7..810b365f48dee 100644 --- a/R/pkg/inst/tests/testthat/test_context.R +++ b/R/pkg/inst/tests/testthat/test_context.R @@ -125,13 +125,13 @@ test_that("getClientModeSparkSubmitOpts() returns spark-submit args from whiteli test_that("sparkJars sparkPackages as comma-separated strings", { expect_warning(processSparkJars(" a, b ")) jars <- suppressWarnings(processSparkJars(" a, b ")) - expect_equal(sapply(jars, basename), c("a", "b")) + expect_equal(lapply(jars, basename), list("a", "b")) jars <- suppressWarnings(processSparkJars(" abc ,, def ")) - expect_equal(sapply(jars, basename), c("abc", "def")) + expect_equal(lapply(jars, basename), list("abc", "def")) jars <- suppressWarnings(processSparkJars(c(" abc ,, def ", "", "xyz", " ", "a,b"))) - expect_equal(sapply(jars, basename), c("abc", "def", "xyz", "a", "b")) + expect_equal(lapply(jars, basename), list("abc", "def", "xyz", "a", "b")) p <- processSparkPackages(c("ghi", "lmn")) expect_equal(p, c("ghi", "lmn"))