You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2019/06/15 23:36:14 UTC

[arrow] branch master updated: ARROW-5590: [R] Run "no libarrow" R build in the same CI entry if possible

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 99ee662  ARROW-5590: [R] Run "no libarrow" R build in the same CI entry if possible
99ee662 is described below

commit 99ee6624340cd2d92fd25083fa3a9e54a30e70a6
Author: Neal Richardson <ne...@gmail.com>
AuthorDate: Sun Jun 16 08:36:00 2019 +0900

    ARROW-5590: [R] Run "no libarrow" R build in the same CI entry if possible
    
    In reading the Travis docs to work on a different issue, I got an idea for how to poke in the without-libarrow check before the C++ lib gets installed in the same job.
    
    I also removed the `latex: false` flag from the job, so it will also test building the package man pages, which CRAN will do.
    
    Author: Neal Richardson <ne...@gmail.com>
    
    Closes #4580 from nealrichardson/merge-r-travis-jobs and squashes the following commits:
    
    7b1a11bad <Neal Richardson> Gah, :rat:
    8b080f48b <Neal Richardson> Move test asserting that the R package is built with the C++ lib
    466762cd8 <Neal Richardson> cd
    08b0b35df <Neal Richardson> Use remotes instead
    c8571ec6e <Neal Richardson> Move up where devtools is installed
    21bc6c436 <Neal Richardson> Attempt to merge with/without libarrow R Travis jobs
---
 .travis.yml                                       | 29 +++++++++--------------
 r/tests/testthat/helper-arrow.R                   |  2 +-
 r/tests/testthat/{helper-arrow.R => test-arrow.R} |  9 +++----
 3 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 36a2dcc..ca38431 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -336,10 +336,9 @@ matrix:
     after_success:
     - pushd ${TRAVIS_BUILD_DIR}/go/arrow
     - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
-  - name: R
+  - name: R (with and without libarrow)
     language: r
     cache: packages
-    latex: false
     dist: xenial
     env:
     - ARROW_TRAVIS_PARQUET=1
@@ -348,6 +347,14 @@ matrix:
     # Have to copy-paste this here because of how R's build steps work
     - eval `python $TRAVIS_BUILD_DIR/ci/detect-changes.py`
     - if [ $ARROW_CI_R_AFFECTED != "1" ]; then exit; fi
+    # First check that it builds without libarrow
+    - pushd ${TRAVIS_BUILD_DIR}/r
+    - R -e 'install.packages("remotes"); remotes::install_deps(dep = TRUE)'
+    - R CMD build .
+    - R CMD check arrow_*tar.gz
+    - rm arrow_*tar.gz
+    - popd
+    # Now, proceed to install the c++ lib and the rest of the job
     - |
         if [ $TRAVIS_OS_NAME == "linux" ]; then
           sudo bash -c "echo -e 'Acquire::Retries 10; Acquire::http::Timeout \"20\";' > /etc/apt/apt.conf.d/99-travis-retry"
@@ -363,25 +370,11 @@ matrix:
     - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/cpp-install/lib
     - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$TRAVIS_BUILD_DIR/cpp-install/lib/pkgconfig
     - export CXX11FLAGS=-Wall
+    # Add this env var so we can assert in the tests that the library is installed correctly
+    - export TEST_R_WITH_ARROW=TRUE
     - pushd ${TRAVIS_BUILD_DIR}/r
     after_success:
     - Rscript ../ci/travis_upload_r_coverage.R
-  - name: R_no_libarrow
-    language: r
-    cache: packages
-    latex: false
-    dist: xenial
-    before_install:
-    # Have to copy-paste this here because of how R's build steps work
-    - eval `python $TRAVIS_BUILD_DIR/ci/detect-changes.py`
-    - if [ $ARROW_CI_R_AFFECTED != "1" ]; then exit; fi
-    - |
-        if [ $TRAVIS_OS_NAME == "linux" ]; then
-          sudo bash -c "echo -e 'Acquire::Retries 10; Acquire::http::Timeout \"20\";' > /etc/apt/apt.conf.d/99-travis-retry"
-          sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-          sudo apt-get update -qq
-        fi
-    - pushd ${TRAVIS_BUILD_DIR}/r
 
 after_failure:
 - |
diff --git a/r/tests/testthat/helper-arrow.R b/r/tests/testthat/helper-arrow.R
index 5dd63e8..78e001f 100644
--- a/r/tests/testthat/helper-arrow.R
+++ b/r/tests/testthat/helper-arrow.R
@@ -17,7 +17,7 @@
 
 test_that <- function(what, code) {
   testthat::test_that(what, {
-    skip_if(!arrow:::arrow_available(), "arrow C++ library not available")
+    skip_if(!arrow::arrow_available(), "arrow C++ library not available")
     code
   })
 }
diff --git a/r/tests/testthat/helper-arrow.R b/r/tests/testthat/test-arrow.R
similarity index 82%
copy from r/tests/testthat/helper-arrow.R
copy to r/tests/testthat/test-arrow.R
index 5dd63e8..0685bd0 100644
--- a/r/tests/testthat/helper-arrow.R
+++ b/r/tests/testthat/test-arrow.R
@@ -15,9 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-test_that <- function(what, code) {
-  testthat::test_that(what, {
-    skip_if(!arrow:::arrow_available(), "arrow C++ library not available")
-    code
+context("General checks")
+
+if (identical(Sys.getenv("TEST_R_WITH_ARROW"), "TRUE")) {
+  testthat::test_that("Arrow C++ is available", {
+    expect_true(arrow_available())
   })
 }