Skip to content

Commit

Permalink
fix r tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Jan 30, 2024
1 parent deab4ae commit 2f177fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source("data.R")
test_that("scalar vector functions behave as intended", {
sdf <- SparkR::createDataFrame(
data.frame(
wkt = "POLYGON ((0 0, 0 2, 1 2, 1 0, 0 0))",
wkt = "POLYGON ((2 1, 1 2, 2 3, 2 1))",
point_wkt = "POINT (1 1)"
)
)
Expand Down
3 changes: 2 additions & 1 deletion R/sparkR-mosaic/tests.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(testthat)

spark_location <- Sys.getenv("SPARK_HOME")
lib_location <- Sys.getenv("MOSAIC_LIB_PATH")
library(SparkR, lib.loc = c(file.path(spark_location, "R", "lib")))
.libPaths(c(file.path(spark_location, "R", "lib"), .libPaths()))

Expand All @@ -12,7 +13,7 @@ install.packages(package_file, repos=NULL)
library(sparkrMosaic)

# find the mosaic jar in staging
staging_dir <- "/home/runner/work/mosaic/mosaic/staging/"
staging_dir <- if (lib_location == "") {"/home/runner/work/mosaic/mosaic/staging/"} else {lib_location}
mosaic_jar <- list.files(staging_dir)
mosaic_jar <- mosaic_jar[grep("jar-with-dependencies.jar", mosaic_jar, fixed=T)]
print("Looking for mosaic jar in")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("scalar vector functions behave as intended", {
sdf <- sdf_copy_to(
sc,
data.frame(
wkt = "POLYGON ((0 0, 0 2, 1 2, 1 0, 0 0))",
wkt = "POLYGON ((2 1, 1 2, 2 3, 2 1))",
point_wkt = "POINT (1 1)"
)
)
Expand Down

0 comments on commit 2f177fd

Please sign in to comment.