Github user shivaram commented on a diff in the pull request: https://github.com/apache/spark/pull/19657#discussion_r148979924 --- Diff: R/pkg/tests/run-all.R --- @@ -60,3 +60,22 @@ if (identical(Sys.getenv("NOT_CRAN"), "true")) { NULL, "summary") } + +# clean up if Spark was downloaded for the test run +# get0 not supported before R 3.2.0 +sparkDownloaded <- mget(".sparkDownloaded"[1L], + envir = SparkR:::.sparkREnv, + inherits = TRUE, + ifnotfound = list(FALSE))[[1L]] +if (sparkDownloaded) { + unlink(sparkDownloadedDir, recursive = TRUE, force = TRUE) + + # .cache/spark, or on Windows, LOCALAPPDATA\Apache\Spark\Cache (there are 3 levels) + parentDir <- SparkR:::sparkCachePath() + dirs <- list(parentDir, dirname(parentDir), dirname(dirname(parentDir))) + lapply(dirs, function(d) { + if (length(list.files(d, all.files = TRUE, include.dirs = TRUE, no.. = TRUE)) == 0) { --- End diff -- One consequence of this is that if we run `R CMD check --as-cran` we will do the download twice -- once for the unit tests and once for the vignettes
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org