Skip to content
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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

WillAyd
Copy link
Contributor

@WillAyd WillAyd commented Nov 9, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.63%. Comparing base (44e8eb9) to head (e7959e0).
Report is 29 commits behind head on main.

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     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@paleolimbot paleolimbot left a 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
Comment on lines 430 to 431
# TODO: does this propoagate to projects using as a subproject?
add_compile_definitions("-DNANOARROW_ARROW_FOUND")
Copy link
Member

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.

@@ -517,6 +520,27 @@ if(NANOARROW_BUILD_TESTS)
gmock_main
nanoarrow_coverage_config)

list(APPEND
Copy link
Contributor Author

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) || \
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants