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

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, dirName, commandList)
Definition: addOnTests.py:18

Member Function Documentation

def addOnTests.testit.run (   self)

Definition at line 29 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.

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)
def run(self)
Definition: addOnTests.py:29

Member Data Documentation

addOnTests.testit.commandList

Definition at line 21 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.dirName

Definition at line 20 of file addOnTests.py.

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

addOnTests.testit.nfail

Definition at line 24 of file addOnTests.py.

addOnTests.testit.npass

Definition at line 25 of file addOnTests.py.

addOnTests.testit.report

Definition at line 23 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.status