CMS 3D CMS Logo

Public Member Functions | Public Attributes

run_regression::RegressionTest Class Reference

List of all members.

Public Member Functions

def __init__
def finalize
def runOnDb
def runOnReference

Public Attributes

 label
 n_res
 out_value
 refDb
 resDb
 resTags

Detailed Description

Definition at line 208 of file run_regression.py.


Constructor & Destructor Documentation

def run_regression::RegressionTest::__init__ (   self,
  conn 
)

Definition at line 210 of file run_regression.py.

00211                               :
00212         self.resDb = results_db.ResultsDB( conn )
00213         self.refDb = reference_db.ReferenceDB( conn )
00214         self.label = None
00215         self.n_res = 0
00216         self.resTags = None
00217         self.out_value = None


Member Function Documentation

def run_regression::RegressionTest::finalize (   self,
  writeFlag 
)

Definition at line 271 of file run_regression.py.

00272                                    :
00273 
00274         reStr = "\!L\!([^!]+)\!TR\!([^!]+)\!TA\!([^!]+)\!RR\!([^!]+)\!RA\!([^!]+)"
00275         for i in range (0, self.n_res):
00276                 reStr +=  "\!C"+str(i)+"\!(\d+)"
00277         #print 'restr1=',reStr
00278 
00279         pattern = re.compile(reStr)
00280         matching = pattern.findall(self.out_value)
00281         stdoutMod = pattern.sub("", self.out_value)
00282         timeStamp = self.resDb.getDate()
00283         stat = "SUCCESS"
00284         runID = 0
00285         if( writeFlag ):
00286                 runID = self.resDb.getNewRunId()
00287         for match in matching:
00288                 #print match
00289                 if( writeFlag):
00290                         self.resDb.writeResult(runID, timeStamp, match,self.resTags)
00291                 for i in range(5, len(match)):
00292                         if( match[i] != str(0) ):
00293                                 stat = "FAILURE"
00294         print stdoutMod
00295         if( writeFlag ):
00296                 self.resDb.addResultLog(runID, stdoutMod)
00297         print "Test '%s' runID=%d" %(self.label, runID)
00298         print "Exit status=%s" %stat
00299         print "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"

def run_regression::RegressionTest::runOnDb (   self,
  label,
  release,
  arch,
  path 
)

Definition at line 218 of file run_regression.py.

00219                                                  :
00220         relID = reference_db.ExtractID(release)
00221         print 'Running test "'+label+'" on rel='+release+' arch='+arch+' from path= '+path
00222         cmds = """
00223 echo ""
00224 echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
00225 echo "Candidate release: """+release+""" "
00226 echo "Arch: """+arch+""" "
00227 echo "Path: """+path+""" "
00228 echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
00229 """
00230         testSeq = ParseXML("sequences.xml", label)
00231         self.n_res = len(testSeq[1])
00232         if(self.n_res == 0):
00233             print "Error : no test sequence found for label %s"%label
00234             return 0
00235         self.resTags = []
00236         for step in testSeq[1]:
00237                 self.resTags.append( step[2] )
00238         releases = self.refDb.listReleases( relID )
00239         for rel in releases:
00240                 cmd  = RunTest( label,testSeq, release, arch, path, rel[0], rel[1], rel[2])
00241                 cmds += cmd
00242         self.out_value =  ExecuteCommand( cmds )
00243         self.label = label
00244         return len(releases)

def run_regression::RegressionTest::runOnReference (   self,
  label,
  release,
  arch,
  path,
  refRelease,
  refArch,
  refPath 
)

Definition at line 245 of file run_regression.py.

00246                                                                                       :
00247         relID = reference_db.ExtractID(release)
00248         print "Testing "+release+" "+arch+" from path: "+path
00249         curs = conn.cursor()
00250         cmds = """
00251 echo ""
00252 echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
00253 echo "Candidate release: """+release+""" "
00254 echo "Arch: """+arch+""" "
00255 echo "Path: """+path+""" "
00256 echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
00257 """
00258         testSeq = ParseXML("sequences.xml", label)
00259         self.n_res = len( testSeq[1] )
00260         if(self.n_res == 0):
00261                 print "Error : no test sequence found for label %s"%label
00262                 return 0
00263         self.resTags = []
00264         for step in testSeq[1]:
00265                 self.resTags.append( step[2] )
00266         cmd = RunTest(label,testSeq, release, arch, path, refRelease, refArch, refPath)
00267         cmds += cmd
00268         self.out_value =  ExecuteCommand( cmds )
00269         self.label = label
00270         return 1


Member Data Documentation

Definition at line 210 of file run_regression.py.

Definition at line 210 of file run_regression.py.

Definition at line 210 of file run_regression.py.

Definition at line 210 of file run_regression.py.

Definition at line 210 of file run_regression.py.

Definition at line 210 of file run_regression.py.