Skip to content

Commit f6713b0

Browse files
authored
Store a test object in the CCDB (#360)
* Store a test object in the CCDB with its version number for future backward compatibility testing * add missing metadata for qo
1 parent b9862a6 commit f6713b0

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

Framework/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ foreach(t testTaskInterface testWorkflow testTaskRunner testCheckWorkflow
297297
target_include_directories(${t} PRIVATE ${CMAKE_SOURCE_DIR})
298298
endforeach()
299299

300-
target_include_directories(testVersion PRIVATE
301-
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
300+
target_include_directories(testVersion PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
301+
target_include_directories(testCcdbDatabase PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
302302

303303
set_property(TEST testWorkflow PROPERTY TIMEOUT 10)
304304
set_property(TEST testWorkflow PROPERTY LABELS slow)

Framework/test/testCcdbDatabase.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <unordered_map>
1919
#include "QualityControl/CcdbDatabase.h"
2020
#include "QualityControl/QcInfoLogger.h"
21+
#include "QualityControl/Version.h"
2122

2223
#define BOOST_TEST_MODULE CcdbDatabase test
2324
#define BOOST_TEST_MAIN
@@ -99,6 +100,24 @@ BOOST_AUTO_TEST_CASE(ccdb_store)
99100
f.backend->storeQO(qo1);
100101
}
101102

103+
BOOST_AUTO_TEST_CASE(ccdb_store_for_future_tests)
104+
{
105+
// this test is storing a version of the objects in a different directory.
106+
// The goal is to keep old versions of the objects, in old formats, for future backward compatibility testing.
107+
test_fixture f;
108+
109+
TH1F* h1 = new TH1F("to_be_kept", "asdf", 100, 0, 99);
110+
h1->FillRandom("gaus", 12345);
111+
shared_ptr<MonitorObject> mo1 = make_shared<MonitorObject>(h1, "task", "TST_KEEP");
112+
mo1->addMetadata("Run", o2::quality_control::core::Version::GetQcVersion().getString());
113+
shared_ptr<QualityObject> qo1 = make_shared<QualityObject>("check", vector{ string("input1"), string("input2") }, "TST_KEEP");
114+
qo1->setQuality(Quality::Bad);
115+
qo1->addMetadata("Run", o2::quality_control::core::Version::GetQcVersion().getString());
116+
117+
f.backend->storeMO(mo1);
118+
f.backend->storeQO(qo1);
119+
}
120+
102121
BOOST_AUTO_TEST_CASE(ccdb_retrieve, *utf::depends_on("ccdb_store"))
103122
{
104123
test_fixture f;

0 commit comments

Comments
 (0)