Repository: spark
Updated Branches:
  refs/heads/branch-2.2 b4f4be396 -> 1e4cca02f


[SPARK-22817][R] Use fixed testthat version for SparkR tests in AppVeyor

## What changes were proposed in this pull request?

`testthat` 2.0.0 is released and AppVeyor now started to use it instead of 
1.0.2. And then, we started to have R tests failed in AppVeyor. See - 
https://ci.appveyor.com/project/ApacheSoftwareFoundation/spark/build/1967-master

```
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
  object 'run_tests' not found
Calls: ::: -> get
```

This seems because we rely on internal `testthat:::run_tests` here:

https://github.com/r-lib/testthat/blob/v1.0.2/R/test-package.R#L62-L75

https://github.com/apache/spark/blob/dc4c351837879dab26ad8fb471dc51c06832a9e4/R/pkg/tests/run-all.R#L49-L52

However, seems it was removed out from 2.0.0.  I tried few other exposed APIs 
like `test_dir` but I failed to make a good compatible fix.

Seems we better fix the `testthat` version first to make the build passed.

## How was this patch tested?

Manually tested and AppVeyor tests.

Author: hyukjinkwon <gurwls...@gmail.com>

Closes #20003 from HyukjinKwon/SPARK-22817.

(cherry picked from commit c2aeddf9eae2f8f72c244a4b16af264362d6cf5d)
Signed-off-by: hyukjinkwon <gurwls...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1e4cca02
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1e4cca02
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1e4cca02

Branch: refs/heads/branch-2.2
Commit: 1e4cca02f9ea4899fa59e6df4295780f0729d6d2
Parents: b4f4be3
Author: hyukjinkwon <gurwls...@gmail.com>
Authored: Sun Dec 17 14:40:41 2017 +0900
Committer: hyukjinkwon <gurwls...@gmail.com>
Committed: Sun Dec 17 14:41:05 2017 +0900

----------------------------------------------------------------------
 appveyor.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1e4cca02/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index bc527e8..c7660f1 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -42,7 +42,9 @@ install:
   # Install maven and dependencies
   - ps: .\dev\appveyor-install-dependencies.ps1
   # Required package for R unit tests
-  - cmd: R -e "install.packages(c('knitr', 'rmarkdown', 'testthat', 'e1071', 
'survival'), repos='http://cran.us.r-project.org')"
+  - cmd: R -e "install.packages(c('knitr', 'rmarkdown', 'devtools', 'e1071', 
'survival'), repos='http://cran.us.r-project.org')"
+  # Here, we use the fixed version of testthat. For more details, please see 
SPARK-22817.
+  - cmd: R -e "devtools::install_version('testthat', version = '1.0.2', 
repos='http://cran.us.r-project.org')"
   - cmd: R -e "packageVersion('knitr'); packageVersion('rmarkdown'); 
packageVersion('testthat'); packageVersion('e1071'); packageVersion('survival')"
 
 build_script:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to