Skip to content

Commit d9b02a9

Browse files
tsafinclaude
andcommitted
feat: Add comprehensive GTest suite for Lance writer
Implements comprehensive unit and integration tests for Lance FFI writer: **Test Coverage:** - Basic initialization and path handling - Single and multiple batch writes - Schema locking and validation - Empty and null batch handling - Nullable field support - All major Arrow data types (int32/64, float32/64, utf8, date32, boolean) - Proper cleanup and destructor handling **Test Organization:** - LanceWriterBasicTest: Initialization tests - LanceWriterIntegrationTest: End-to-end dataset creation tests - LanceWriterDataTypeTest: Data type support verification **Configuration:** - Tests are guarded by TPCH_ENABLE_LANCE and TPCH_BUILD_TESTS flags - Only built when both flags are enabled - Follows existing test patterns (Paimon writer tests) - Uses CMake gtest_discover_tests for automatic test discovery **Benefits:** - Regression prevention for Lance writer functionality - Validates critical operations (schema locking, batch streaming) - Ensures null handling and error conditions work correctly - Safe guard for future maintenance and refactoring Addresses PR #5 review comment: "Large new Lance writer functionality has no automated tests" Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 0bafb2c commit d9b02a9

2 files changed

Lines changed: 572 additions & 0 deletions

File tree

tests/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,25 @@ if(TPCH_BUILD_TESTS)
7878
gtest_discover_tests(paimon_writer_test)
7979
endif()
8080

81+
# Lance writer tests (only if Lance FFI is enabled)
82+
if(TPCH_ENABLE_LANCE)
83+
add_executable(lance_writer_test
84+
lance_writer_test.cpp
85+
)
86+
87+
target_link_libraries(lance_writer_test
88+
PRIVATE
89+
tpch_core
90+
GTest::gtest_main
91+
)
92+
93+
target_include_directories(lance_writer_test
94+
PRIVATE
95+
${CMAKE_CURRENT_SOURCE_DIR}/../include
96+
)
97+
98+
gtest_discover_tests(lance_writer_test)
99+
endif()
100+
81101
message(STATUS "Test targets configured successfully")
82102
endif()

0 commit comments

Comments
 (0)