dongjoon-hyun commented on a change in pull request #27359:
[SPARK-23435][SPARKR][TESTS] Update testthat to >= 2.0.0
URL: https://github.com/apache/spark/pull/27359#discussion_r370975518
##########
File path: R/pkg/tests/run-all.R
##########
@@ -60,11 +59,23 @@ if (identical(Sys.getenv("NOT_CRAN"), "true")) {
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
# set random seed for predictable results. mostly for base's sample() in
tree and classification
set.seed(42)
- # for testthat 1.0.2 later, change reporter from "summary" to
default_reporter()
- testthat:::run_tests("SparkR",
- file.path(sparkRDir, "pkg", "tests", "fulltests"),
- NULL,
- "summary")
+
+ # To be removed once testthat 1.x is removed from all builds
+ if (grepl("^1\\..*", installed.packages()["testthat", "Version"])) {
+ # testthat 1.x
+ test_runner <- testthat:::run_tests
+ reporter <- "summary"
+
+ } else {
+ # testthat >= 2.0.0
+ test_runner <- testthat:::test_package_dir
+ reporter <- testthat::default_reporter()
+ }
+
+ test_runner("SparkR",
+ file.path(sparkRDir, "pkg", "tests", "fulltests"),
Review comment:
Indentation?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]