CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
addOnTests.StandardTester Class Reference
Inheritance diagram for addOnTests.StandardTester:

Public Member Functions

def __init__ (self, nThrMax=4)
 
def activeThreads (self)
 
def dumpTest (self)
 
def file2Path (self, rFile)
 
def prepare (self)
 
def runTests (self, testList=None)
 
def upload (self, tgtDir)
 

Public Attributes

 commands
 
 devPath
 
 maxThreads
 
 relPath
 
 threadList
 

Detailed Description

Definition at line 65 of file addOnTests.py.

Constructor & Destructor Documentation

def addOnTests.StandardTester.__init__ (   self,
  nThrMax = 4 
)

Definition at line 67 of file addOnTests.py.

67  def __init__(self, nThrMax=4):
68 
69  self.threadList = []
70  self.maxThreads = nThrMax
71  self.prepare()
72 
73  return
74 
def __init__(self, nThrMax=4)
Definition: addOnTests.py:67

Member Function Documentation

def addOnTests.StandardTester.activeThreads (   self)

Definition at line 75 of file addOnTests.py.

References MatrixRunner.MatrixRunner.threadList, and addOnTests.StandardTester.threadList.

Referenced by addOnTests.StandardTester.runTests().

75  def activeThreads(self):
76 
77  nActive = 0
78  for t in self.threadList:
79  if t.isAlive() : nActive += 1
80 
81  return nActive
82 
def addOnTests.StandardTester.dumpTest (   self)

Definition at line 158 of file addOnTests.py.

References join(), and edm.print().

158  def dumpTest(self):
159  print(",".join(self.commands.keys()))
160  return
161 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def addOnTests.StandardTester.file2Path (   self,
  rFile 
)

Definition at line 162 of file addOnTests.py.

References addOnTests.StandardTester.devPath, and addOnTests.StandardTester.relPath.

162  def file2Path(self,rFile):
163 
164  fullPath = self.relPath + rFile
165  if os.path.exists(self.devPath + rFile): fullPath = self.devPath + rFile
166  return fullPath
167 
def file2Path(self, rFile)
Definition: addOnTests.py:162
def addOnTests.StandardTester.prepare (   self)

Definition at line 83 of file addOnTests.py.

83  def prepare(self):
84 
85  self.devPath = os.environ['LOCALRT'] + '/src/'
86  self.relPath = self.devPath
87  if 'CMSSW_RELEASE_BASE' in os.environ and (os.environ['CMSSW_RELEASE_BASE'] != ""): self.relPath = os.environ['CMSSW_RELEASE_BASE'] + '/src/'
88 
89  lines = { 'read312RV' : ['cmsRun '+self.file2Path('Utilities/ReleaseScripts/scripts/read312RV_cfg.py')],
90  '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"],
91  '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"],
92  '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"],
93  'pat1' : ['cmsRun '+self.file2Path('PhysicsTools/PatAlgos/test/IntegrationTest_cfg.py')],
94  }
95 
96  hltFlag_data = ' realData=True globalTag=@ inputFiles=@ '
97  hltFlag_mc = ' realData=False globalTag=@ inputFiles=@ '
98 
99  hltTests = {
100  'hlt_mc_Fake' : ['cmsDriver.py TTbar_Tauola_8TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run1_mc_Fake --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --fileout file:RelVal_Raw_Fake_MC.root',
101  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake.py')+hltFlag_mc,
102  'cmsDriver.py RelVal -s HLT:Fake,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run1_mc_Fake --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --processName=HLTRECO --filein file:RelVal_Raw_Fake_MC.root --fileout file:RelVal_Raw_Fake_MC_HLT_RECO.root'],
103  'hlt_mc_Fake1': ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake1 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_25ns --fileout file:RelVal_Raw_Fake1_MC.root',
104  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake1.py')+hltFlag_mc,
105  'cmsDriver.py RelVal -s HLT:Fake1,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake1 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_25ns --processName=HLTRECO --filein file:RelVal_Raw_Fake1_MC.root --fileout file:RelVal_Raw_Fake1_MC_HLT_RECO.root'],
106  'hlt_mc_Fake2': ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake2 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2016 --fileout file:RelVal_Raw_Fake2_MC.root',
107  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake2.py')+hltFlag_mc,
108  'cmsDriver.py RelVal -s HLT:Fake2,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake2 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2016 --processName=HLTRECO --filein file:RelVal_Raw_Fake2_MC.root --fileout file:RelVal_Raw_Fake2_MC_HLT_RECO.root'],
109  'hlt_mc_2018v36' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_2018v36 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_2018v36_MC.root',
110  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_2018v36.py')+hltFlag_mc,
111  'cmsDriver.py RelVal -s HLT:2018v36,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_2018v36 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_2018v36_MC.root --fileout file:RelVal_Raw_2018v36_MC_HLT_RECO.root'],
112  'hlt_mc_GRun' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_GRun --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_GRun_MC.root',
113  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_GRun.py')+hltFlag_mc,
114  'cmsDriver.py RelVal -s HLT:GRun,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_GRun --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_GRun_MC.root --fileout file:RelVal_Raw_GRun_MC_HLT_RECO.root'],
115  'hlt_mc_HIon' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_HIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018_pp_on_AA --fileout file:RelVal_Raw_HIon_MC.root',
116  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_HIon.py')+hltFlag_mc,
117  'cmsDriver.py RelVal -s HLT:HIon,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_HIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018_pp_on_AA --processName=HLTRECO --filein file:RelVal_Raw_HIon_MC.root --fileout file:RelVal_Raw_HIon_MC_HLT_RECO.root'],
118  'hlt_mc_PIon' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_PIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_PIon_MC.root',
119  'cmsRun ' + self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_PIon.py')+hltFlag_mc,
120  'cmsDriver.py RelVal -s HLT:PIon,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_PIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_PIon_MC.root --fileout file:RelVal_Raw_PIon_MC_HLT_RECO.root'],
121  'hlt_mc_PRef' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_PRef --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_PRef_MC.root',
122  'cmsRun ' + self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_PRef.py')+hltFlag_mc,
123  'cmsDriver.py RelVal -s HLT:PRef,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_PRef --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_PRef_MC.root --fileout file:RelVal_Raw_PRef_MC_HLT_RECO.root'],
124  'hlt_data_Fake' : ['cmsDriver.py RelVal -s L1REPACK:GT1 --data --scenario=pp -n 10 --conditions auto:run1_hlt_Fake --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --fileout file:RelVal_Raw_Fake_DATA.root --filein /store/data/Run2012A/MuEG/RAW/v1/000/191/718/14932935-E289-E111-830C-5404A6388697.root',
125  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake.py')+hltFlag_data,
126  'cmsDriver.py RelVal -s HLT:Fake,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run1_data_Fake --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --processName=HLTRECO --filein file:RelVal_Raw_Fake_DATA.root --fileout file:RelVal_Raw_Fake_DATA_HLT_RECO.root'],
127  'hlt_data_Fake1': ['cmsDriver.py RelVal -s L1REPACK:GCTGT --data --scenario=pp -n 10 --conditions auto:run2_hlt_Fake1 --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_25ns --fileout file:RelVal_Raw_Fake1_DATA.root --filein /store/data/Run2015D/MuonEG/RAW/v1/000/256/677/00000/80950A90-745D-E511-92FD-02163E011C5D.root',
128  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake1.py')+hltFlag_data,
129  'cmsDriver.py RelVal -s HLT:Fake1,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_Fake1 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_25ns --processName=HLTRECO --filein file:RelVal_Raw_Fake1_DATA.root --fileout file:RelVal_Raw_Fake1_DATA_HLT_RECO.root'],
130  'hlt_data_Fake2': ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_Fake2 --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2016 --fileout file:RelVal_Raw_Fake2_DATA.root --filein /store/data/Run2016B/JetHT/RAW/v1/000/272/762/00000/C666CDE2-E013-E611-B15A-02163E011DBE.root',
131  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_Fake2.py')+hltFlag_data,
132  'cmsDriver.py RelVal -s HLT:Fake2,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_Fake2 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2016 --processName=HLTRECO --filein file:RelVal_Raw_Fake2_DATA.root --fileout file:RelVal_Raw_Fake2_DATA_HLT_RECO.root'],
133  'hlt_data_2018v36' : ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_2018v36 --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_2018v36_DATA.root --filein /store/data/Run2017A/HLTPhysics4/RAW/v1/000/295/606/00000/36DE5E0A-3645-E711-8FA1-02163E01A43B.root',
134  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_2018v36.py')+hltFlag_data,
135  'cmsDriver.py RelVal -s HLT:2018v36,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_2018v36 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_2018v36_DATA.root --fileout file:RelVal_Raw_2018v36_DATA_HLT_RECO.root'],
136  'hlt_data_GRun' : ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_GRun --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --fileout file:RelVal_Raw_GRun_DATA.root --filein /store/data/Run2017A/HLTPhysics4/RAW/v1/000/295/606/00000/36DE5E0A-3645-E711-8FA1-02163E01A43B.root',
137  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_GRun.py')+hltFlag_data,
138  'cmsDriver.py RelVal -s HLT:GRun,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_GRun --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_GRun_DATA.root --fileout file:RelVal_Raw_GRun_DATA_HLT_RECO.root'],
139  'hlt_data_HIon' : ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_HIon --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018_pp_on_AA --fileout file:RelVal_Raw_HIon_DATA.root --filein /store/data/Run2018D/HIMinimumBias0/RAW/v1/000/325/112/00000/660F62BB-9932-D645-A4A4-0BBBDA3963E8.root --customise_commands=\'from FWCore.ParameterSet.MassReplace import massSearchReplaceAnyInputTag; massSearchReplaceAnyInputTag(process.SimL1Emulator,"rawDataCollector","rawDataRepacker",False,True)\'',
140  'cmsRun '+self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_HIon.py')+hltFlag_data,
141  'cmsDriver.py RelVal -s HLT:HIon,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_HIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018_pp_on_AA --processName=HLTRECO --filein file:RelVal_Raw_HIon_DATA.root --fileout file:RelVal_Raw_HIon_DATA_HLT_RECO.root'],
142  'hlt_data_PIon' : ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_PIon --relval 9000,50 --datatier "RAW" --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --eventcontent RAW --fileout file:RelVal_Raw_PIon_DATA.root --filein /store/data/Run2017A/HLTPhysics4/RAW/v1/000/295/606/00000/36DE5E0A-3645-E711-8FA1-02163E01A43B.root',
143  'cmsRun ' + self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_PIon.py')+hltFlag_data,
144  'cmsDriver.py RelVal -s HLT:PIon,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_PIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_PIon_DATA.root --fileout file:RelVal_Raw_PIon_DATA_HLT_RECO.root'],
145  'hlt_data_PRef' : ['cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_PRef --relval 9000,50 --datatier "RAW" --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2018 --eventcontent RAW --fileout file:RelVal_Raw_PRef_DATA.root --filein /store/data/Run2017A/HLTPhysics4/RAW/v1/000/295/606/00000/36DE5E0A-3645-E711-8FA1-02163E01A43B.root',
146  'cmsRun ' + self.file2Path('HLTrigger/Configuration/test/OnLine_HLT_PRef.py')+hltFlag_data,
147  'cmsDriver.py RelVal -s HLT:PRef,RAW2DIGI,L1Reco,RECO --data --scenario=pp -n 10 --conditions auto:run2_data_PRef --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2018 --processName=HLTRECO --filein file:RelVal_Raw_PRef_DATA.root --fileout file:RelVal_Raw_PRef_DATA_HLT_RECO.root'],
148  }
149 
150  self.commands={}
151  for dirName, command in lines.items():
152  self.commands[dirName] = command
153 
154  for dirName, commandList in hltTests.items():
155  self.commands[dirName] = commandList
156  return
157 
def file2Path(self, rFile)
Definition: addOnTests.py:162
def addOnTests.StandardTester.runTests (   self,
  testList = None 
)

Definition at line 168 of file addOnTests.py.

References MatrixRunner.MatrixRunner.activeThreads(), addOnTests.StandardTester.activeThreads(), addOnTests.StandardTester.commands, MatrixRunner.MatrixRunner.maxThreads, addOnTests.StandardTester.maxThreads, edm.print(), str, MatrixRunner.MatrixRunner.threadList, and addOnTests.StandardTester.threadList.

168  def runTests(self, testList = None):
169 
170  actDir = os.getcwd()
171 
172  if not os.path.exists('addOnTests'):
173  os.makedirs('addOnTests')
174  os.chdir('addOnTests')
175 
176  nfail=0
177  npass=0
178  report=''
179 
180  print('Running in %s thread(s)' % self.maxThreads)
181 
182  for dirName, command in self.commands.items():
183 
184  if testList and not dirName in testList:
185  del self.commands[dirName]
186  continue
187 
188  # make sure we don't run more than the allowed number of threads:
189  while self.activeThreads() >= self.maxThreads:
190  time.sleep(10)
191  continue
192 
193  print('Preparing to run %s' % str(command))
194  current = testit(dirName, command)
195  self.threadList.append(current)
196  current.start()
197  time.sleep(random.randint(1,5)) # try to avoid race cond by sleeping random amount of time [1,5] sec
198 
199  # wait until all threads are finished
200  while self.activeThreads() > 0:
201  time.sleep(5)
202 
203  # all threads are done now, check status ...
204  for pingle in self.threadList:
205  pingle.join()
206  for f in pingle.nfail: nfail += f
207  for p in pingle.npass: npass += p
208  report += pingle.report
209  print(pingle.report)
210  sys.stdout.flush()
211 
212  reportSumm = '\n %s tests passed, %s failed \n' %(npass,nfail)
213  print(reportSumm)
214 
215  runall_report_name='runall-report.log'
216  runall_report=open(runall_report_name,'w')
217  runall_report.write(report+reportSumm)
218  runall_report.close()
219 
220  # get the logs to the logs dir:
221  print('==> in :', os.getcwd())
222  print(' going to copy log files to logs dir ...')
223  if not os.path.exists('logs'):
224  os.makedirs('logs')
225  for dirName in self.commands:
226  cmd = "for L in `ls "+dirName+"/*.log`; do cp $L logs/cmsDriver-`dirname $L`_`basename $L` ; done"
227  print("going to ",cmd)
228  os.system(cmd)
229 
230  import pickle
231  pickle.dump(self.commands, open('logs/addOnTests.pkl', 'w') )
232 
233  os.chdir(actDir)
234 
235  return
236 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def runTests(self, testList=None)
Definition: addOnTests.py:168
#define str(s)
def addOnTests.StandardTester.upload (   self,
  tgtDir 
)

Definition at line 237 of file addOnTests.py.

References edm.print(), and str.

237  def upload(self, tgtDir):
238 
239  print("in ", os.getcwd())
240 
241  if not os.path.exists(tgtDir):
242  os.makedirs(tgtDir)
243 
244  cmd = 'tar cf - addOnTests.log addOnTests/logs | (cd '+tgtDir+' ; tar xf - ) '
245  try:
246  print('executing: ',cmd)
247  ret = os.system(cmd)
248  if ret != 0:
249  print("ERROR uploading logs:", ret, cmd)
250  except Exception as e:
251  print("EXCEPTION while uploading addOnTest-logs : ", str(e))
252 
253  return
254 
255 
def upload(self, tgtDir)
Definition: addOnTests.py:237
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
#define str(s)

Member Data Documentation

addOnTests.StandardTester.commands

Definition at line 150 of file addOnTests.py.

Referenced by addOnTests.StandardTester.runTests().

addOnTests.StandardTester.devPath

Definition at line 85 of file addOnTests.py.

Referenced by addOnTests.StandardTester.file2Path().

addOnTests.StandardTester.maxThreads

Definition at line 70 of file addOnTests.py.

Referenced by addOnTests.StandardTester.runTests().

addOnTests.StandardTester.relPath

Definition at line 86 of file addOnTests.py.

Referenced by addOnTests.StandardTester.file2Path().

addOnTests.StandardTester.threadList