-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Make Arrow C++ dependency optional #677
base: main
Are you sure you want to change the base?
Conversation
ad45d3e
to
bc80f47
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #677 +/- ##
==========================================
+ Coverage 86.29% 87.63% +1.34%
==========================================
Files 94 101 +7
Lines 13604 14537 +933
==========================================
+ Hits 11739 12739 +1000
+ Misses 1865 1798 -67
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you're still working on this, but just two high level comments to think about:
- We probably want a CMake option of
-DNANOARROW_TESTS_WITH_ARROW
(where if it's ON, configuration will fail if Arrow is not found, and if it's OFF, tests are never built with arrow). Having it be automatic makes it relatively easy to accidentally think you are testing with Arrow C++ when CMake actually failed to locate it. - There are a few tests where the entire test is useless, but many of them only have Arrow C++ as a small component (notably: the schema init ones). It doesn't have to be perfect at the end of this PR, but before the next release we will ideally have full (or at least not reduced) test coverage without any of the Arrow C++ integration tests running.
- An alternative to compiling tests with a define is to move the (portions of) tests that need Arrow C++ to separate files (Arrow C++-specific integration tests, perhaps under integration/).
CMakeLists.txt
Outdated
# TODO: does this propoagate to projects using as a subproject? | ||
add_compile_definitions("-DNANOARROW_ARROW_FOUND") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does. You probably want target_compile_definitions(xxxx_test PRIVATE -DNANOARROW_ARROW_FOUND)
for every test because the tests are what actually need this define set. You could do something fancy like we do with the nanoarrow_coverage_config
(define an interface target that the tests "link to"), or bite the bullet and use a foreach()
loop to link tests (sort of like you do in the meson config), which we probably should have done a while ago anyway.
bc80f47
to
3ffc2f7
Compare
@@ -517,6 +520,27 @@ if(NANOARROW_BUILD_TESTS) | |||
gmock_main | |||
nanoarrow_coverage_config) | |||
|
|||
list(APPEND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just kept the loop scoped to adding the define for now, although there is (as you've already mentioned) potential to use this for other parts of the config
@@ -1719,7 +1812,8 @@ TEST(ArrayTest, ArrayTestAppendToRunEndEncodedArray) { | |||
EXPECT_EQ(ArrowArrayFinishBuilding(&array, NANOARROW_VALIDATION_LEVEL_FULL, &error), | |||
NANOARROW_OK); | |||
|
|||
#if !defined(ARROW_VERSION_MAJOR) || ARROW_VERSION_MAJOR < 12 | |||
#if !defined(NANOARROW_BUILD_TESTS_WITH_ARROW) || !defined(ARROW_VERSION_MAJOR) || \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add this here or leave as is?
No description provided.