CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, dirName, commandList)
 
def run (self)
 

Public Attributes

 commandList
 
 dirName
 
 nfail
 
 npass
 
 report
 
 status
 

Detailed Description

Definition at line 17 of file addOnTests.py.

Constructor & Destructor Documentation

◆ __init__()

def addOnTests.testit.__init__ (   self,
  dirName,
  commandList 
)

Definition at line 18 of file addOnTests.py.

18  def __init__(self,dirName, commandList):
19  Thread.__init__(self)
20  self.dirName = dirName
21  self.commandList = commandList
22  self.status=-1
23  self.report=''
24  self.nfail=[]
25  self.npass=[]
26 
27  return
28 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ run()

def addOnTests.testit.run (   self)

Definition at line 29 of file addOnTests.py.

References mps_setup.append, addOnTests.testit.commandList, addOnTests.testit.dirName, analyzer.Analyzer.dirName, MuonIsolationDQM.dirName, VariablePlotter::SubDirectory.dirName, VariablePlotter::Directory.dirName, runall.testit.nfail, WorkFlowRunner.WorkFlowRunner.nfail, addOnTests.testit.nfail, TShapeAnalysis.npass, runall.testit.npass, WorkFlowRunner.WorkFlowRunner.npass, addOnTests.testit.npass, FastTimerService_cff.range, python.rootplot.root2matplotlib.replace(), runall.testit.report, WorkFlowRunner.WorkFlowRunner.report, addOnTests.testit.report, ALIUtils.report, dataset.BaseDataset.report, and dataset.Dataset.report.

29  def run(self):
30 
31  startime='date %s' %time.asctime()
32  exitCodes = []
33 
34  for command in self.commandList:
35 
36  if not os.path.exists(self.dirName):
37  os.makedirs(self.dirName)
38 
39  commandbase = command.replace(' ','_').replace('/','_')
40  logfile='%s.log' % commandbase[:150].replace("'",'').replace('"','').replace('../','')
41 
42  executable = 'cd '+self.dirName+'; '+command+' > '+logfile+' 2>&1'
43 
44  ret = os.system(executable)
45  exitCodes.append( ret )
46 
47  endtime='date %s' %time.asctime()
48  tottime='%s-%s'%(endtime,startime)
49 
50  for i in range(len(self.commandList)):
51  command = self.commandList[i]
52  exitcode = exitCodes[i]
53  if exitcode != 0:
54  log='%s : FAILED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
55  self.report+='%s\n'%log
56  self.nfail.append(1)
57  self.npass.append(0)
58  else:
59  log='%s : PASSED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
60  self.report+='%s\n'%log
61  self.nfail.append(0)
62  self.npass.append(1)
63 
64  return
65 
def replace(string, replacements)

Member Data Documentation

◆ commandList

addOnTests.testit.commandList

Definition at line 21 of file addOnTests.py.

Referenced by addOnTests.testit.run().

◆ dirName

addOnTests.testit.dirName

Definition at line 20 of file addOnTests.py.

Referenced by addOnTests.testit.run(), and core.JSONAnalyzer.JSONAnalyzer.write().

◆ nfail

addOnTests.testit.nfail

Definition at line 24 of file addOnTests.py.

Referenced by addOnTests.testit.run().

◆ npass

addOnTests.testit.npass

Definition at line 25 of file addOnTests.py.

Referenced by addOnTests.testit.run().

◆ report

addOnTests.testit.report

Definition at line 23 of file addOnTests.py.

Referenced by addOnTests.testit.run().

◆ status

addOnTests.testit.status