5 from __future__
import print_function
8 from optparse
import OptionParser
11 simple script to run diff-root only on tests which show differences in diff-pool
12 either create a diff pool by hand first or just download the ESDTAGCOMM_comparison_log
13 of the current nightly:
15 wget https://atlas-rtt.cern.ch/prod/tct/rel_3/20.1.X.Y-VAL/build/x86_64-slc6-gcc48-opt/offline/Tier0ChainTests/ESDTAGCOMM_comparison/ESDTAGCOMM_comparison_log
17 then execute the script with the comparison log:
19 ./runDiffRootOnChanged.py -f ESDTAGCOMM_comparison_log
26 first evaluate last 40 lines of the diff-pool log
27 and extract tests with changed
32 f =
open(filename,
'r')
33 lines = f.readlines(); f.close()
34 for line
in lines[-40:]:
36 changed_tests.append(line.split()[0])
41 exectute diff-root command
44 outfile =
"%s_%s.log" %(test, ftype)
45 command =
"acmd.py diff-root %s %s --error-mode resilient --ignore-leaves RecoTimingObj_p1_HITStoRDO_timings RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_timings --entries 10 >> %s" %(pool_list[0], pool_list[1], outfile)
54 since some pool files are located on eos others are on afs
55 this little hack is needed to get all files for the comparison
59 repl =
"rel%s" %(ref.split(
"rel")[1].
split(
"/")[0])
60 newversion =
"rel_%i" %(
int(repl.split(
"_")[1])+1)
61 filename = ref.replace(repl,newversion)
62 if os.path.isfile(filename):
63 ESD_list.append(filename)
67 extract path to pool files from diff-pool log
68 skip tests with failing tests
69 then execute diff_root for every pair
78 f =
open(logfile,
'r')
80 if ".pool.root" in line
and "open" in line
and test
in line:
82 AOD_list.append( line.split(
'[')[1].
split(
']')[0])
84 ESD_list.append( line.split(
'[')[1].
split(
']')[0])
88 if len(ESD_list) == 1:
90 if len(AOD_list) == 1:
94 print (
"ERROR missing ESD file for diff-root comparison" )
96 print (
"INFO evaluate ESD diff-root")
100 print (
"ERROR missing AOD file for diff-root comparison")
102 print (
"INFO evaluate AOD diff-root")
108 rels = [
"rel_2",
"rel_3"]
110 path =
"/afs/cern.ch/atlas/project/RTT/prod/Results/tct/REL/20.1.X.Y-VAL/build/x86_64-slc6-gcc48-opt/offline/Tier0ChainTests/%s/" %(test)
117 aod = path.replace(
"REL",rel)+
"myAOD.pool.root"
118 esd = path.replace(
"REL",rel)+
"myESD.pool.root"
119 if os.path.isfile(aod):
121 if os.path.isfile(esd):
125 if len(ESD_list) < 2:
126 print (
"ERROR missing ESD file for diff-root comparison" )
128 print (
"INFO evaluate ESD diff-root")
131 if len(AOD_list) < 2:
132 print (
"ERROR missing AOD file for diff-root comparison")
134 print (
"INFO evaluate AOD diff-root")
137 parser=OptionParser(usage=
"\n ./runDiffRootOnChanged.py --file <file name with full diff-pool log > \n")
138 parser.add_option(
"-f",
"--file" ,type=
"string" ,dest=
"filename" ,default=
"none" ,help=
"diff pool log file")
139 parser.add_option(
"-d",
"--dryRun", action=
"store_true" ,dest=
"dryrun" ,default=
False ,help=
"only dumps commands on screen")
142 (options,args)=parser.parse_args()
143 logfile = options.filename
147 print (
"INFO following tests changed")
153 print (
"All Tests are identical no further checks needed")