Definition at line 66 of file addOnTests.py.
◆ __init__()
def addOnTests.StandardTester.__init__ |
( |
|
self, |
|
|
|
nThrMax = 4 |
|
) |
| |
Definition at line 68 of file addOnTests.py.
68 def __init__(self, nThrMax=4):
71 self.maxThreads = nThrMax
◆ activeThreads()
def addOnTests.StandardTester.activeThreads |
( |
|
self | ) |
|
◆ dumpTest()
def addOnTests.StandardTester.dumpTest |
( |
|
self | ) |
|
◆ file2Path()
def addOnTests.StandardTester.file2Path |
( |
|
self, |
|
|
|
rFile |
|
) |
| |
◆ prepare()
def addOnTests.StandardTester.prepare |
( |
|
self | ) |
|
Definition at line 84 of file addOnTests.py.
86 self.devPath = os.environ[
'LOCALRT'] +
'/src/'
87 self.relPath = self.devPath
88 if 'CMSSW_RELEASE_BASE' in os.environ
and (os.environ[
'CMSSW_RELEASE_BASE'] !=
""): self.relPath = os.environ[
'CMSSW_RELEASE_BASE'] +
'/src/'
90 lines = {
'read312RV' : [
'cmsRun '+self.file2Path(
'Utilities/ReleaseScripts/scripts/read312RV_cfg.py')],
91 'fastsim' : [
"cmsDriver.py TTbar_8TeV_TuneCUETP8M1_cfi --conditions auto:run1_mc --fast -n 100 --eventcontent AODSIM,DQM --relval 100000,1000 -s GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,EI,VALIDATION --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --datatier GEN-SIM-DIGI-RECO,DQMIO --beamspot Realistic8TeVCollision"],
92 'fastsim1' : [
"cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi --conditions auto:run2_mc_l1stage1 --fast -n 100 --eventcontent AODSIM,DQM --relval 100000,1000 -s GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,EI,VALIDATION --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --datatier GEN-SIM-DIGI-RECO,DQMIO --beamspot NominalCollision2015 --era Run2_25ns"],
93 'fastsim2' : [
"cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi --conditions auto:run2_mc --fast -n 100 --eventcontent AODSIM,DQM --relval 100000,1000 -s GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,EI,VALIDATION --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --datatier GEN-SIM-DIGI-RECO,DQMIO --beamspot NominalCollision2015 --era Run2_2016"],
94 'pat1' : [
'cmsRun '+self.file2Path(
'PhysicsTools/PatAlgos/test/IntegrationTest_cfg.py')],
98 hltFlag_data =
' realData=True globalTag=@ inputFiles=@ '
99 hltFlag_mc =
' realData=False globalTag=@ inputFiles=@ '
100 from Configuration.HLT.addOnTestsHLT
import addOnTestsHLT
102 for key
in hltTestsToAdd:
104 hltTests[key] = [hltTestsToAdd[key][0],
105 'cmsRun '+self.file2Path(hltTestsToAdd[key][1])+hltFlag_data,
106 hltTestsToAdd[key][2]]
108 hltTests[key] = [hltTestsToAdd[key][0],
109 'cmsRun '+self.file2Path(hltTestsToAdd[key][1])+hltFlag_mc,
110 hltTestsToAdd[key][2]]
112 hltTests[key] = [hltTestsToAdd[key][0],
113 'cmsRun '+self.file2Path(hltTestsToAdd[key][1]),
114 hltTestsToAdd[key][2]]
117 for dirName, command
in lines.items():
118 self.commands[dirName] = command
120 for dirName, commandList
in hltTests.items():
121 self.commands[dirName] = commandList
◆ runTests()
def addOnTests.StandardTester.runTests |
( |
|
self, |
|
|
|
testList = None |
|
) |
| |
Definition at line 134 of file addOnTests.py.
134 def runTests(self, testList = None):
138 if not os.path.exists(
'addOnTests'):
139 os.makedirs(
'addOnTests')
140 os.chdir(
'addOnTests')
146 print(
'Running in %s thread(s)' % self.maxThreads)
148 for dirName, command
in self.commands.
items():
150 if testList
and not dirName
in testList:
151 del self.commands[dirName]
155 while self.activeThreads() >= self.maxThreads:
159 print(
'Preparing to run %s' %
str(command))
160 current = testit(dirName, command)
161 self.threadList.
append(current)
163 time.sleep(random.randint(1,5))
166 while self.activeThreads() > 0:
170 for pingle
in self.threadList:
172 for f
in pingle.nfail: nfail += f
173 for p
in pingle.npass: npass += p
174 report += pingle.report
178 reportSumm =
'\n %s tests passed, %s failed \n' %(npass,nfail)
181 runall_report_name=
'runall-report.log'
182 runall_report=open(runall_report_name,
'w')
183 runall_report.write(report+reportSumm)
184 runall_report.close()
187 print(
'==> in :', os.getcwd())
188 print(
' going to copy log files to logs dir ...')
189 if not os.path.exists(
'logs'):
191 for dirName
in self.commands:
192 cmd =
"for L in `ls "+dirName+
"/*.log`; do cp $L logs/cmsDriver-`dirname $L`_`basename $L` ; done"
193 print(
"going to ",cmd)
197 pickle.dump(self.commands, open(
'logs/addOnTests.pkl',
'wb'), protocol=2)
References MatrixRunner.MatrixRunner.activeThreads(), addOnTests.StandardTester.activeThreads(), mps_setup.append, addOnTests.StandardTester.commands, mps_monitormerge.items, MatrixRunner.MatrixRunner.maxThreads, addOnTests.StandardTester.maxThreads, edm.print(), str, MatrixRunner.MatrixRunner.threadList, and addOnTests.StandardTester.threadList.
◆ upload()
def addOnTests.StandardTester.upload |
( |
|
self, |
|
|
|
tgtDir |
|
) |
| |
Definition at line 203 of file addOnTests.py.
205 print(
"in ", os.getcwd())
207 if not os.path.exists(tgtDir):
210 cmd =
'tar cf - addOnTests.log addOnTests/logs | (cd '+tgtDir+
' ; tar xf - ) '
212 print(
'executing: ',cmd)
215 print(
"ERROR uploading logs:", ret, cmd)
216 except Exception
as e:
217 print(
"EXCEPTION while uploading addOnTest-logs : ",
str(e))
References edm.print(), and str.
◆ commands
addOnTests.StandardTester.commands |
◆ devPath
addOnTests.StandardTester.devPath |
◆ maxThreads
addOnTests.StandardTester.maxThreads |
◆ relPath
addOnTests.StandardTester.relPath |
◆ threadList
addOnTests.StandardTester.threadList |