Conversation
FORM's internal interface can write a data product, add a simple field to that data product, read it back, and print the same fields from both. Really tests ROOT's schema evolution facilities for now. This will become more relevant for RNTuple and other formats, and it may even cover future advanced schema evolution features in FORM.
FORM uses ROOT's schema evolution.
|
@phlexbot format |
|
No automatic format fixes were necessary. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #388 +/- ##
==========================================
- Coverage 86.45% 84.45% -2.00%
==========================================
Files 119 126 +7
Lines 2399 3526 +1127
Branches 387 650 +263
==========================================
+ Hits 2074 2978 +904
- Misses 207 333 +126
- Partials 118 215 +97
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
wwuoneway
left a comment
There was a problem hiding this comment.
It looks like extra_member is intended to be an independent test. Considering renaming it to something more descriptive of the scenario would be helpful. I noticed some duplicated files between theextra_member folder and the up-level one, that’s fine if the tests are meant to be self-contained, but it may be worth factoring out common pieces in the future.
| @@ -0,0 +1,29 @@ | |||
| //Schema evolution test component: write old version of a data product to disk | |||
|
|
|||
| #include "test/form/data_products/track_start.hpp" | |||
There was a problem hiding this comment.
Should it be #include "test/form/data_products/extra_member/track_start.hpp" here?
There was a problem hiding this comment.
No, this is intentional. form_root_schema_write_test writes the old, non-extra_member version of the data product to a file. form_root_schema_read_test reads the old product with only the new product's definition. ROOT should automatically fill in the in-memory new product with as much of the old product's data as possible.
You make a good point here, and I'm willing to make it happen. But In contrast, when the situation I'm testing happens in production, someone would change the definition of I think we could make a directory with a name like |
|
@aolivier23 Thanks for the clarification. I think we can proceed this way for now. I'll make a note for future. |
|
This is a well-structured test for an important feature. Just one comment: The log comparison between write and read tests correctly verifies that existing fields (x, y, z) survive schema evolution. It might also be worth considering whether to include m_index in the operator<< output, just to give explicit visibility into how the new field is defaulted after reading the old product — though this is a minor point and may be outside the scope of what this test is trying to demonstrate. |
That's fair. I'm leaning towards revisiting this when phlex has more to say about schema evolution in the far future. The main situation I want to test for, me misusing RNTuple in the near future, would probably crash the schema evolution reader before we even got to file comparisons. |
FORM should currently support ROOT's schema evolution facilities for adapting to relatively simple changes to data products. Verifying this is useful for FORM development because RNTuple exposes an interface that bypasses schema evolution. This test builds on the
Track_Startdata product used in existing FORM tests to verify that FORM's TTree container successfully supports ROOT's schema evolution. Future FORM container technologies will be accompanied by an extension of this test.