From 4b3445dfc4839690b9b95ed56dfedc2fd37275d2 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Fri, 10 Jan 2020 15:59:01 +0100
Subject: [PATCH] Migrate LArAthenaPool TPCnv unit tests to
 ComponentAccumulator LArTPCnv_15.6.7_test - passes (updated reference file)
 LArTPCnv_20.1.7.2_test - passes

---
 .../LArCnv/LArAthenaPool/CMakeLists.txt       |  5 +++--
 .../LArAthenaPool/share/LArTPCnv_15.6.7.ref   |  1 -
 .../test/LArTPCnv_15.6.7_test.py              | 20 +++++++++++++++++++
 .../test/LArTPCnv_20.1.7.2_test.py            | 16 +++++++++++++++
 4 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100755 LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_15.6.7_test.py
 create mode 100755 LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_20.1.7.2_test.py

diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt b/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
index 4aaae8c42d3..87879c99de6 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
@@ -15,13 +15,14 @@ atlas_add_poolcnv_library( LArAthenaPoolPoolCnv
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
+atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 # Set up (a) test(s) for the converter(s):
 find_package( AthenaPoolUtilitiesTest )
 
 if( ATHENAPOOLUTILITIESTEST_FOUND )
-  run_tpcnv_legacy_test( LArTPCnv_15.6.7   ESD-15.6.7-data )
-  run_tpcnv_legacy_test( LArTPCnv_20.1.7.2 ESD-20.1.7.2 )
+  run_tpcnv_test( LArTPCnv_15.6.7   ESD-15.6.7-data )
+  run_tpcnv_test( LArTPCnv_20.1.7.2 ESD-20.1.7.2 )
 else()
    message( WARNING
       "Couldn't find AthenaPoolUtilitiesTest. No test(s) set up." )
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
index 3abdda8890a..942d315df66 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
@@ -17,7 +17,6 @@ Py:ConfigurableDb WARNING   -TrigHLTJetHypo: TrigHLTJetHypo.TrigHLTJetHypoConf -
 Py:ConfigurableDb WARNING Fix your cmt/requirements file !!
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
 EventInfoMgtInit: Got release version  AtlasOffline-rel_4
-Py:IOVDbSvc.CondDB WARNING Failed to extract year from project tag . Guessing run2
 Py:IOVDbSvc.CondDB    INFO Configuring database instance CONDBR2 based on project tag 
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance CONDBR2
 Data source lookup using /afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasCore/rel_4/InstallArea/XML/AtlasAuthentication/dblookup.xml file
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_15.6.7_test.py b/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_15.6.7_test.py
new file mode 100755
index 00000000000..4ec73e189a0
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_15.6.7_test.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+
+from AthenaPoolUtilities.TPCnvTestConfig import TPCnvTest
+
+if __name__ == "__main__":
+    infile = 'esd/ESD-15.6.7-data.pool.root'
+
+    keys = [
+        #LArDigitContainer_p1
+        'LArDigitContainer_EMClust',
+        'LArDigitContainer_Thinned',
+
+        #LArNoisyROSummary_p1
+        'LArNoisyROSummary',
+    ]
+
+    TPCnvTest(infile, keys, useGeoModelSvc=True)
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_20.1.7.2_test.py b/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_20.1.7.2_test.py
new file mode 100755
index 00000000000..ad71ce3c0ab
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/test/LArTPCnv_20.1.7.2_test.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+
+from AthenaPoolUtilities.TPCnvTestConfig import TPCnvTest
+
+if __name__ == "__main__":
+    infile = 'esd/ESD-20.1.7.2.pool.root'
+
+    keys = [
+        #LArNoisyROSummary_p3
+        'LArNoisyROSummary',
+    ]
+
+    TPCnvTest(infile, keys)
-- 
GitLab