You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by am...@apache.org on 2022/04/20 15:49:25 UTC

[arrow] branch master updated: ARROW-11071: [R][CI] Use processx to set up minio and flight servers in tests

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

amolina 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 aa9b87eb0f ARROW-11071: [R][CI] Use processx to set up minio and flight servers in tests
aa9b87eb0f is described below

commit aa9b87eb0fc4eeb0089010ac25d5cb680500ebdb
Author: Jacob Wujciak-Jens <ja...@wujciak.de>
AuthorDate: Wed Apr 20 17:49:18 2022 +0200

    ARROW-11071: [R][CI] Use processx to set up minio and flight servers in tests
    
    Closes #12822 from assignUser/ARROW-11071-flight-tests
    
    Authored-by: Jacob Wujciak-Jens <ja...@wujciak.de>
    Signed-off-by: Alessandro Molina <am...@turbogears.org>
---
 ci/scripts/r_test.sh                  | 19 +++++++++++++++++--
 docker-compose.yml                    |  1 +
 r/tests/testthat/test-python-flight.R |  2 +-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ci/scripts/r_test.sh b/ci/scripts/r_test.sh
index b9d6d0d684..aa2f613184 100755
--- a/ci/scripts/r_test.sh
+++ b/ci/scripts/r_test.sh
@@ -90,11 +90,26 @@ SCRIPT="as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')
       message('Running minio for S3 tests (if build supports them)')
       minio_dir <- tempfile()
       dir.create(minio_dir)
-      pid <- sys::exec_background('minio', c('server', minio_dir))
-      on.exit(tools::pskill(pid))
+      pid_minio <- sys::exec_background('minio', c('server', minio_dir))
+      on.exit(tools::pskill(pid_minio), add = TRUE)
     }
   }
 
+  if (reticulate::py_module_available('pyarrow')) {
+      message('Running flight demo server for tests.')
+      pid_flight <- sys::exec_background(
+          'python',
+          c(
+              '-c',
+              paste0(
+                  '__import__(\"sys\").path.append(\"./inst\"); ',
+                  '__import__(\"demo_flight_server\").DemoFlightServer(port=8089).serve()'
+              )
+          )
+      )
+      on.exit(tools::pskill(pid_flight), add = TRUE)
+  }
+
   run_donttest <- identical(tolower(Sys.getenv('_R_CHECK_DONTTEST_EXAMPLES_', 'true')), 'true')
   if (run_donttest) {
     args <- c(args, '--run-donttest')
diff --git a/docker-compose.yml b/docker-compose.yml
index 8d5dfcd717..f3c67fc4af 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1168,6 +1168,7 @@ services:
     environment:
       <<: *ccache
       ARROW_R_CXXFLAGS: '-Werror'
+      ARROW_FLIGHT: 'ON'
       LIBARROW_BUILD: 'false'
       NOT_CRAN: 'true'
       ARROW_R_DEV: ${ARROW_R_DEV}
diff --git a/r/tests/testthat/test-python-flight.R b/r/tests/testthat/test-python-flight.R
index db67cd67fc..6fdf38f815 100644
--- a/r/tests/testthat/test-python-flight.R
+++ b/r/tests/testthat/test-python-flight.R
@@ -18,7 +18,7 @@
 # Assumes:
 # * We've already done arrow::install_pyarrow()
 # * R -e 'arrow::load_flight_server("demo_flight_server")$DemoFlightServer(port = 8089)$serve()'
-# TODO: set up CI job to test this, or some way of running a background process
+
 if (process_is_running("demo_flight_server")) {
   client <- flight_connect(port = 8089)
   flight_obj <- tempfile()