From c1d4d91809cda6917cde3a8fc69b2005953a498e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 14 Mar 2019 15:15:50 +0100
Subject: [PATCH] IOVDbSvc: Test updates.

Add test reference files.
Use JO search path to find test txt JO file.
---
 Database/IOVDbSvc/CMakeLists.txt              | 12 +++-------
 Database/IOVDbSvc/share/FolderTypes_test.ref  | 19 +++++++++++++++
 Database/IOVDbSvc/share/IOVDbConn_test.ref    | 22 ++++++++++++++++++
 .../share/IOVDbCoolFunctions_test.ref         |  3 +++
 Database/IOVDbSvc/share/IOVDbFolder_test.ref  | 21 +++++++++++++++++
 Database/IOVDbSvc/share/IOVDbParser_test.ref  | 23 +++++++++++++++++++
 .../share/IOVDbStringFunctions_test.ref       |  3 +++
 .../IOVDbSvc/share/IOVDbSvc_BoostTest.ref     |  5 ++++
 .../IOVDbSvc/share/IOVDbSvc_Boost_test.ref    | 20 ++++++++++++++++
 .../share/ReadFromFileMetaData_test.ref       | 19 +++++++++++++++
 .../IOVDbSvc/test/GaudiKernelFixtureBase.h    |  2 +-
 Database/IOVDbSvc/test/IOVDbConn_test.cxx     |  4 +++-
 12 files changed, 142 insertions(+), 11 deletions(-)
 create mode 100644 Database/IOVDbSvc/share/FolderTypes_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbConn_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbFolder_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbParser_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref
 create mode 100644 Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref
 create mode 100644 Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref

diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 4aa82c1ebdf..1fb54722715 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -68,9 +68,7 @@ atlas_add_test( IOVDbSvc_Boost_test
                 test/IOVDbSvc_Boost_test.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
                 LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} 
-                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" 
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" )
                 
 set_target_properties( IOVDbSvc_IOVDbSvc_Boost_test  PROPERTIES ENABLE_EXPORTS True )
 
@@ -78,9 +76,7 @@ atlas_add_test( IOVDbConn_test
                 SOURCES
                 test/IOVDbConn_test.cxx src/IOVDbConn.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
-                LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool )
                 
 atlas_add_test( IOVDbStringFunctions_test                
                 SOURCES
@@ -122,9 +118,7 @@ atlas_add_test( IOVDbFolder_test
                 test/IOVDbFolder_test.cxx src/IOVDbFolder.cxx src/IOVDbConn.cxx src/IOVDbParser.cxx src/FolderTypes.cxx src/IOVDbCoolFunctions.cxx src/IOVDbStringFunctions.cxx src/ReadFromFileMetaData.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
                 LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool
-                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" 
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG"  )
 
 
 if( NOT SIMULATIONBASE )
diff --git a/Database/IOVDbSvc/share/FolderTypes_test.ref b/Database/IOVDbSvc/share/FolderTypes_test.ref
new file mode 100644
index 00000000000..0bb37e5e4fb
--- /dev/null
+++ b/Database/IOVDbSvc/share/FolderTypes_test.ref
@@ -0,0 +1,19 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:21:01 2019
+====================================================================================================================================
+ApplicationMgr Ready
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbConn_test.ref b/Database/IOVDbSvc/share/IOVDbConn_test.ref
new file mode 100644
index 00000000000..28037a0591f
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbConn_test.ref
@@ -0,0 +1,22 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Mon Mar  4 16:55:46 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbConn_Boost...   INFO Opening COOL connection for sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200
+IOVDbConn_Boost...   INFO *** COOL  exception caught: Connection on "sqlite_file:IOVDbConnTest.db" cannot be established ( CORAL : "ConnectionPool::getSessionFromNewConnection" from "CORAL/Services/ConnectionService" )
+IOVDbConn_Boost...   INFO Create a new conditions database: sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref b/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref
new file mode 100644
index 00000000000..434668d839b
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref
@@ -0,0 +1,3 @@
+Running 7 test cases...
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbFolder_test.ref b/Database/IOVDbSvc/share/IOVDbFolder_test.ref
new file mode 100644
index 00000000000..28c69fff408
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbFolder_test.ref
@@ -0,0 +1,21 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus089.cern.ch on Thu Mar 14 17:14:44 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbFolder_test     INFO Opening COOL connection for sqlite://;schema=IOVDbFolderTest.db;dbname=OFLP200
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/IOVDbParser_test.ref b/Database/IOVDbSvc/share/IOVDbParser_test.ref
new file mode 100644
index 00000000000..2ea4fc62a96
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbParser_test.ref
@@ -0,0 +1,23 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:21:30 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbParser_test     INFO Folder extraText, Key: addrHeaderOverriding existing value <address_header service_type="71" clid="40774348" /> to new value <address_header service_type="71" clid="40774348" />
+IOVDbParser_test     INFO Folder extraText, Key: keyOverriding existing value /PIXEL/CablingMap to new value /PIXEL/CablingMap
+IOVDbParser_test     INFO Folder extraText, Key: timeStampOverriding existing value run-lumi to new value time
+IOVDbParser_test     INFO Folder extraText, Key: typeNameOverriding existing value AthenaAttributeList to new value AthenaAttributeList
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref b/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref
new file mode 100644
index 00000000000..ed25d3e5764
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref
@@ -0,0 +1,3 @@
+Running 16 test cases...
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref b/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref
new file mode 100644
index 00000000000..3e71bff51e5
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref
@@ -0,0 +1,5 @@
+ApplicationMgr.OutputLevel = 5;
+ApplicationMgr.CreateSvc += { "StoreGateSvc/DetectorStore" };
+IOVDbSvc.Folders = { "/key1"};
+EventPersistencySvc.CnvServices += { "AthenaPoolCnvSvc" };
+MessageSvc.OutputLevel = 5;
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref b/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref
new file mode 100644
index 00000000000..7b911368c88
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref
@@ -0,0 +1,20 @@
+
+
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus089.cern.ch on Thu Mar 14 17:14:43 2019
+====================================================================================================================================
+ApplicationMgr Ready
+Running 10 test cases...
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref b/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref
new file mode 100644
index 00000000000..e263596bf8f
--- /dev/null
+++ b/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref
@@ -0,0 +1,19 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:19:37 2019
+====================================================================================================================================
+ApplicationMgr Ready
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h b/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
index 6f8ecda40a6..b8e9a128615 100644
--- a/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
+++ b/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
@@ -32,7 +32,7 @@ struct GaudiKernelFixtureBase{
     //
     CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); } );
     if (not gaudiIsInitialised){
-      gaudiIsInitialised=Athena_test::initGaudi(searchPath+"IOVDbSvc_BoostTest.txt", svcLoc);
+      gaudiIsInitialised=Athena_test::initGaudi("IOVDbSvc/IOVDbSvc_BoostTest.txt", svcLoc);
     }
   }
 };
diff --git a/Database/IOVDbSvc/test/IOVDbConn_test.cxx b/Database/IOVDbSvc/test/IOVDbConn_test.cxx
index b7e26e53b80..5eec908172e 100644
--- a/Database/IOVDbSvc/test/IOVDbConn_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbConn_test.cxx
@@ -40,7 +40,9 @@ struct IOVDbConnFixture{
   IOVDbConnFixture():msgSvc("msgSvc","test"),
    connectionString("sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200"),
    log(msgSvc.get(), "IOVDbConn_Boost_test"),
-   connection(connectionString, true, log){
+   connection(connectionString, true, log)
+  {
+    (void)unlink ("IOVDbConnTest.db");
   }
 };
 
-- 
GitLab