CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 15 of file addOnTests.py.

Constructor & Destructor Documentation

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

Definition at line 16 of file addOnTests.py.

16  def __init__(self,dirName, commandList):
17  Thread.__init__(self)
18  self.dirName = dirName
19  self.commandList = commandList
20  self.status=-1
21  self.report=''
22  self.nfail=[]
23  self.npass=[]
24 
25  return
26 
def __init__(self, dirName, commandList)
Definition: addOnTests.py:16

Member Function Documentation

def addOnTests.testit.run (   self)

Definition at line 27 of file addOnTests.py.

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

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

Member Data Documentation

addOnTests.testit.commandList

Definition at line 19 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.dirName

Definition at line 18 of file addOnTests.py.

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

addOnTests.testit.nfail

Definition at line 22 of file addOnTests.py.

addOnTests.testit.npass

Definition at line 23 of file addOnTests.py.

addOnTests.testit.report

Definition at line 21 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.status