Skip to content

[TEST] Add ArrowIOHelpers_test (UUID v4 + typed Arrow accessors) - #9560

Merged
timosachsenberg merged 3 commits into
OpenMS:developfrom
timosachsenberg:test/arrowiohelpers-uuid-and-accessors
Jun 19, 2026
Merged

timosachsenberg merged 3 commits into
OpenMS:developfrom
timosachsenberg:test/arrowiohelpers-uuid-and-accessors

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Context

Part of the OpenMS 3.6.0 pre-release testing plan (#9460), §3 (native Parquet I/O).

ArrowIOHelpers — added with the new native-Parquet I/O — had no test file, yet its helpers are used throughout the parquet import/export path:

  • generateUuidV4() produces the bundle identifiers;
  • getColumn / getStringValue / getDoubleValue / getFloatValue / getInt32Value / getInt64Value / getBoolValue / isNull read typed values out of Arrow arrays.

Change

Adds a class test that:

  • validates generateUuidV4() against the UUID v4 spec — canonical 8-4-4-4-12 form, version nibble '4', variant nibble in {8,9,a,b}, all-hex body — and checks 1000 draws are unique;
  • exercises the typed accessors — builds small Arrow arrays/tables and verifies each accessor returns the stored value, falls back to the supplied default / empty string on a null cell and on a null array pointer, that isNull reports correctly, and that getColumn returns the column (and nullptr for a missing optional column).

Notes

  • New test registered in executables.cmake (format_executables_list).
  • Tests only — no production code changes.
  • Builds and passes locally; all assertions execute against real values (verbose-confirmed).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded unit test coverage for Arrow I/O helpers, including UUID v4 format validation, typed array value accessors for strings/numbers/booleans with null handling, and schema/table column lookup behavior (including missing-column handling).
    • Added the Arrow I/O helpers test to the existing test build configuration by linking the same Arrow/Parquet dependencies as related tests.

ArrowIOHelpers (new in the 3.6 native-Parquet I/O) had no test, yet its
helpers are used throughout the parquet import/export path:
- generateUuidV4() produces the bundle identifiers, and
- getColumn / getStringValue / getDoubleValue / getFloatValue / getInt32Value
  / getInt64Value / getBoolValue / isNull read typed values out of Arrow arrays.

Adds a class test that:
- validates generateUuidV4() against the UUID v4 spec (canonical 8-4-4-4-12
  form, version nibble '4', variant nibble in {8,9,a,b}, all-hex body) and
  checks 1000 draws are unique;
- builds small Arrow arrays/tables and verifies each typed accessor returns
  the stored value, falls back to the supplied default / empty string on null
  cells and on a null array pointer, that isNull reports correctly, and that
  getColumn returns the column (and null for a missing optional column).

Registered in executables.cmake (format_executables_list). Part of the
OpenMS 3.6.0 pre-release testing plan (OpenMS#9460). Tests only; no production
code changes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 84f70cf9-8778-49ef-a542-47b4989dbb96

📥 Commits

Reviewing files that changed from the base of the PR and between f3745cb and e087a86.

📒 Files selected for processing (2)
  • src/tests/class_tests/openms/CMakeLists.txt
  • src/tests/class_tests/openms/executables.cmake
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tests/class_tests/openms/executables.cmake

📝 Walkthrough

Walkthrough

A new C++ unit test file ArrowIOHelpers_test.cpp is added, covering generateUuidV4() UUID formatting and uniqueness, typed Arrow array value accessors with null and nullptr handling, and schema column lookup. The test is registered in CMakeLists.txt and executables.cmake.

Changes

ArrowIOHelpers Test Coverage

Layer / File(s) Summary
ArrowIOHelpers test suite: UUID, accessors, and column lookup
src/tests/class_tests/openms/source/ArrowIOHelpers_test.cpp
New test file covering generateUuidV4() canonical structure, version/variant nibble validation, hex uniqueness across 1000 invocations; typed array accessors (getStringValue, getDoubleValue, getFloatValue, getInt32Value, getInt64Value, getBoolValue) with null-row and nullptr-array handling; and getColumn retrieval by name with optional missing-field fallback. Suite is closed with END_SECTION/END_TEST.
Register ArrowIOHelpers_test in CMake configuration
src/tests/class_tests/openms/CMakeLists.txt, src/tests/class_tests/openms/executables.cmake
Conditionally links ArrowIOHelpers_test against ${OPENMS_ARROW_TARGET} and ${OPENMS_PARQUET_TARGET} in CMakeLists.txt; appends ArrowIOHelpers_test to format_executables_list in executables.cmake alongside the existing ArrowSchemaRegistry_test.

Poem

A rabbit hops through Arrow arrays so wide,
UUID v4 checks with nibbles inside,
Nulls are tested, columns found or not,
CMake now lists the test in its slot.
🐇✨ Every hex digit accounted for!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding a comprehensive test suite for ArrowIOHelpers that covers UUID v4 generation and typed Arrow accessors.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Timo Sachsenberg

Please consider applying the following patch:

--- AUTHORS	2026-06-16 00:09:39.573515600 +0000
+++ AUTHORS.new	2026-06-16 00:09:44.796583030 +0000
@@ -23,8 +23,8 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

Copy link
Copy Markdown
Contributor Author

Adversarial review result:

I did not find a blocking issue in this pass. This is a test-only addition for ArrowIOHelpers; the UUID format/variant checks and Arrow value-accessor cases match the current helper implementation. I did not find tracker references in source comments. I did not run the tests locally.

# Conflicts:
#	src/tests/class_tests/openms/CMakeLists.txt
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.

1 participant