Skip to content
Snippets Groups Projects
Commit 042d498e authored by Frank Winklmeier's avatar Frank Winklmeier Committed by Melissa Yexley
Browse files

AthenaPoolUtilities: remove support for TPCnv tests using legacy config

parent 8a6bb1ee
No related branches found
No related tags found
2 merge requests!707402024-04-19: merge of 24.0 into main,!67647Online Event Displays to CA
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( AthenaPoolUtilities )
......@@ -26,16 +26,12 @@ atlas_add_dictionary( AthenaPoolUtilitiesDict
LINK_LIBRARIES AthenaPoolUtilities )
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_scripts( share/post_tpcnvtest.sh )
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Install the CMake code from the package:
atlas_install_generic( cmake/AthenaPoolUtilitiesTestConfig.cmake
DESTINATION cmake )
atlas_install_generic( share/run_tpcnv_legacy_test.sh.in
DESTINATION cmake/modules/scripts
EXECUTABLE )
atlas_install_generic( share/run_tpcnv_test.sh.in
DESTINATION cmake/modules/scripts
EXECUTABLE )
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
#
# @file AthenaPoolUtilities/share/AthenaPoolUtilitiesTestConfig.make
......@@ -8,47 +8,8 @@
#
# Example:
#
# run_tpcnv_legacy_test( TrackParticleTPCnv_17.2.8 AOD-17.2.8-full )
# run_tpcnv_test( TrackParticleTPCnv_17.2.8 AOD-17.2.8-full )
#
function( run_tpcnv_legacy_test testName refName )
cmake_parse_arguments( ARG "" "REFERENCE_TAG" "REQUIRED_LIBRARIES" ${ARGN} )
# The package name is needed for the configuration of the test script:
atlas_get_package_name( pkgName )
# Find the test runner script:
find_file( ATLAS_TPCNV_LEGACY_TEST_RUNNER "run_tpcnv_legacy_test.sh.in"
PATH_SUFFIXES "share" "scripts"
PATHS "${AthenaPoolUtilitiesTest_DIR}/.."
"${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/cmake/modules"
${CMAKE_MODULE_PATH} )
if( NOT ATLAS_TPCNV_LEGACY_TEST_RUNNER )
message( WARNING "Couldn't find run_tpcnv_legacy_test.sh.in" )
return()
endif()
mark_as_advanced( ATLAS_TPCNV_LEGACY_TEST_RUNNER )
# Create the script that will be run:
configure_file( "${ATLAS_TPCNV_LEGACY_TEST_RUNNER}"
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/tpcnv_legacy_${testName}.sh"
@ONLY )
set( _env )
if( ARG_REFERENCE_TAG )
set( _env ENVIRONMENT "ATLAS_REFERENCE_TAG=${pkgName}/${ARG_REFERENCE_TAG}" )
endif()
# Create a test with it:
atlas_add_test( ${testName}
SCRIPT
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/tpcnv_legacy_${testName}.sh"
PROPERTIES TIMEOUT 600
POST_EXEC_SCRIPT "post_tpcnvtest.sh ${testName}" ${_env} )
endfunction( run_tpcnv_legacy_test )
function( run_tpcnv_test testName refName )
cmake_parse_arguments( ARG "" "REFERENCE_TAG" "REQUIRED_LIBRARIES" ${ARGN} )
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
##
# @file AthenaPoolUtilities/share/TPCnvTest.py
# @author sss
# @date Nov 2015
# @brief Helper for testing reading old data files.
#
# This JO can be used to test the reading of an old data file.
#
# Set the variable `infile' to the file to be read.
# If this is not an absolute path, it is looked for under
# /afs/cern.ch/atlas/maxidisk/d33/referencefiles.
# Set the variable keys to the list of SG keys to dump.
# A dump will be made to the file given by appending `.dump'
# to the base part of infile.
# The dump will be compared against a reference file in share.
#
import AthenaCommon.AtlasUnixStandardJob
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from PyUtils.moduleExists import moduleExists
from PyUtils.fprint import fprintln
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
import AthenaPoolCnvSvc.ReadAthenaPool
from future import standard_library
standard_library.install_aliases()
import subprocess
# Make sure we don't have a stale file catalog.
import os
if os.path.exists ('PoolFileCatalog.xml'):
os.remove ('PoolFileCatalog.xml')
if (not 'ATLAS_REFERENCE_TAG' in globals() and
'ATLAS_REFERENCE_TAG' in os.environ):
ATLAS_REFERENCE_TAG = os.environ['ATLAS_REFERENCE_TAG']
refpaths = [os.environ.get ('ATLAS_REFERENCE_DATA', None),
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art',
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs',
'/afs/cern.ch/atlas/maxidisk/d33/referencefiles']
if infile.startswith ('rtt:'):
infile = infile[4:]
from AthenaPoolUtilities.DumperConfig import find_file, Dumper
svcMgr.EventSelector.InputCollections = [ find_file (infile, refpaths) ]
from AthenaCommon.DetFlags import DetFlags
if not globals().get ('noMuon',False):
DetFlags.detdescr.Muon_setOn()
if moduleExists ('MuonRecExample'):
import MuonRecExample.MuonAlignConfig
if not globals().get ('noID',False):
DetFlags.detdescr.ID_setOn()
from AthenaCommon.JobProperties import jobproperties
if jobproperties.Global.DetDescrVersion.isDefault():
jobproperties.Global.DetDescrVersion = 'ATLAS-R1-2012-03-02-00'
have_atlas_geo = moduleExists ('AtlasGeoModel')
if have_atlas_geo:
import AtlasGeoModel.GeoModelInit
import AtlasGeoModel.SetGeometryVersion
svcMgr.GeoModelSvc.IgnoreTagDifference = True
if have_atlas_geo and moduleExists ('TrkEventCnvTools') and moduleExists ('MuonEventCnvTools'):
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
from TrkEventCnvTools import TrkEventCnvToolsConf
EventCnvSuperTool = TrkEventCnvToolsConf.Trk__EventCnvSuperTool('EventCnvSuperTool')
if not hasattr(svcMgr, "MuonIdHelperSvc"):
from AthenaCommon.CfgGetter import getService
svcMgr += getService("MuonIdHelperSvc")
ToolSvc += EventCnvSuperTool
dumper = Dumper ('dumper', infile, keys, refpaths)
topSequence += [dumper]
#!/bin/sh
test=$1
if [ "$test" = "" ]; then
exit 0
fi
testdir=${test}-${CMTCONFIG}
rm -rf $testdir
mkdir $testdir
cd $testdir
#!/bin/sh
for libroot in @ARG_REQUIRED_LIBRARIES@; do
fullpath=""
for p in `echo $LD_LIBRARY_PATH | tr : ' ' `; do
thispath="$p/@CMAKE_SHARED_LIBRARY_PREFIX@${libroot}@CMAKE_SHARED_LIBRARY_SUFFIX@"
if [ -r "$thispath" ]; then
fullpath="$thispath"
fi
done
if [ "$fullpath" = "" ]; then
echo "WARNING: Library $libroot not found; skipping test @testName@"
# Signal post_tpcnvtest.sh to skip the reffile comparison.
touch @testName@-SKIPPED
exit 0
fi
done
rm -f @testName@-SKIPPED
reffile=`echo @CMAKE_CURRENT_SOURCE_DIR@/share/@refName@.pool.root*.ref`
if [ -f "$reffile" ] &&
[ "@CMAKE_CURRENT_SOURCE_DIR@" != "@CMAKE_CURRENT_BINARY_DIR@" ]; then
refbase=`basename $reffile`
@CMAKE_COMMAND@ -E make_directory ../share
@CMAKE_COMMAND@ -E create_symlink \
$reffile ../share/$refbase
fi
testdir=@testName@
rm -rf $testdir
mkdir $testdir
cd $testdir
athena.py @pkgName@/@testName@_test.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment