jonkeane commented on a change in pull request #9641:
URL: https://github.com/apache/arrow/pull/9641#discussion_r589665819



##########
File path: r/tests/testthat/test-info.R
##########
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+test_that("arrow_info()", {
+  expect_is(arrow_info(), "arrow_info")
+  expect_output(print(arrow_info()), "Arrow package version")
+  options(arrow.foo=FALSE)
+  expect_output(print(arrow_info()), "arrow.foo")

Review comment:
       I might be missing something here, but I think there might be some 
confusion here: we don't need to export the function in order to be able to 
test it. `testthat` makes it so that both exported and unexported objects are 
available when tests are run, so if we were to test `runtime_info()` we 
wouldn't need to export it.
   
   But I agree with Neal that we probably should leave this test as is. It's 
difficult to have a test that would query the actual value being received and 
have it pass on the many environments that we need to run tests, so the best we 
could do is test that the names that `runtime_info()` are right and possibly 
that the values are within a known-good list. That's not a particularly good 
use of our time here (since that really should be tested in the cpp layer 
itself).
   
   I don't see any good reason to export `runtime_info()` someone can get the 
info from the exported `arrow_info()` if they need it. (most people don't even 
need this info, it's helpful for debugging mostly)  




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to