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 16 of file addOnTests.py.

Constructor & Destructor Documentation

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

Definition at line 17 of file addOnTests.py.

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

Member Function Documentation

def addOnTests.testit.run (   self)

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

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

Member Data Documentation

addOnTests.testit.commandList

Definition at line 20 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.dirName

Definition at line 19 of file addOnTests.py.

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

addOnTests.testit.nfail

Definition at line 23 of file addOnTests.py.

addOnTests.testit.npass

Definition at line 24 of file addOnTests.py.

addOnTests.testit.report

Definition at line 22 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.status