From 12cc213e88b6151e1d2edef768e8356bade038b9 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 12 Jun 2024 10:20:19 +0200 Subject: [PATCH 1/3] Add a schema evolution that triggers failure --- tests/schema_evolution/datalayout_new.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/schema_evolution/datalayout_new.yaml b/tests/schema_evolution/datalayout_new.yaml index e9938fd1c..8c08df933 100644 --- a/tests/schema_evolution/datalayout_new.yaml +++ b/tests/schema_evolution/datalayout_new.yaml @@ -33,6 +33,11 @@ components : - int x - int y_new + ex2::NamespaceStructLong: + Members: + - int64_t x + - int64_t y_new + ex2::NamespaceInNamespaceStruct: Members: - ex2::NamespaceStruct data @@ -191,7 +196,7 @@ datatypes : Members: - std::int16_t i16Val{42} // some int16 value - std::array floats {3.14f, 1.23f} // some float values - - ex2::NamespaceStruct s{10, 11} // one that we happen to know works + - ex2::NamespaceStructLong s{10, 11} // one that we happen to know works - double d{9.876e5} // double val - CompWithInit comp // To make sure that the default initializer of the component does what it should From b16c2de6caaa5f0ab9569722d8f5dfec060fa8dc Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 12 Jun 2024 10:22:18 +0200 Subject: [PATCH 2/3] Fix schema evolution script --- python/podio_schema_evolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/podio_schema_evolution.py b/python/podio_schema_evolution.py index b3b498fa2..ea417ab3b 100755 --- a/python/podio_schema_evolution.py +++ b/python/podio_schema_evolution.py @@ -31,7 +31,7 @@ class AddedComponent(SchemaChange): def __init__(self, component, name): self.component = component self.name = name - super().__init__(f"'{self.component.name}' has been added") + super().__init__(f"'{self.name}' has been added") class DroppedComponent(SchemaChange): From 3192fcf3f96714003cb5cebf81a3018e2c050d09 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 12 Jun 2024 10:20:29 +0200 Subject: [PATCH 3/3] Add tests for running the schema evolution script standalone --- tests/schema_evolution/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/schema_evolution/CMakeLists.txt b/tests/schema_evolution/CMakeLists.txt index a86963d82..c6eabb388 100644 --- a/tests/schema_evolution/CMakeLists.txt +++ b/tests/schema_evolution/CMakeLists.txt @@ -33,4 +33,20 @@ function(PODIO_CREATE_READ_NEW_DATA_TEST sourcefile additional_libs) ) endfunction() +add_test( + NAME schema-evolution-script + COMMAND ${PROJECT_SOURCE_DIR}/python/podio_schema_evolution.py + ${CMAKE_CURRENT_SOURCE_DIR}/datalayout_new.yaml + ${PROJECT_SOURCE_DIR}/tests/datalayout.yaml +) + +add_test( + NAME schema-evolution-script-with-evol + COMMAND + ${PROJECT_SOURCE_DIR}/python/podio_schema_evolution.py + --evo ${CMAKE_CURRENT_SOURCE_DIR}/schema_evolution.yaml + ${CMAKE_CURRENT_SOURCE_DIR}/datalayout_new.yaml + ${PROJECT_SOURCE_DIR}/tests/datalayout.yaml +) + add_subdirectory(root_io)