def updateResults(self, dryRun=False): startDir = os.getcwd() os.chdir('newPerf-'+self.part) print 'revg> in', os.getcwd(),' going to update results' for item in self.toDo: baseIn, xmlFileIn = os.path.split(item) base = baseIn.replace('newPerf-1of2/', '').replace('newPerf-2of2/', '') xmlFileFull = xmlFileIn.replace('_vlgd.xml', '_valgrind-1.xml') xmlFile = xmlFileIn.replace('_vlgd.xml', '_vlgd-1.xml') print xmlFileFull if not os.path.exists( os.path.join(base,xmlFileFull) ) : continue # ignore files which did not get redone # first convert the files to some manageable size cmd = 'cd '+base+';' cmd += 'xsltproc --output '+xmlFile cmd += ' ' + scriptPath+'/filterOutValgrindLeakErrors.xsl ' + xmlFileFull try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when filtering XML file " + xmlFileFull + ' in ' + base print " got ", str(e) # then copy over the files to AFS: from helpers import getStamp try: cyc, day, stamp = getStamp(self.release) except Exception, e: print "revg> ERROR when trying to get cyc,day,stamp from release for ", self.release print " got :", str(e) cyc, day, stamp = ('none', 'none', 'none')
def __init__(self, rel, arch='slc5_ia32_gcc434'): self.data = None self.release = rel self.arch = arch day, stamp, cyc = getStamp(self.release) self.cycle = cyc self.outPath = config.siteInfo[ 'OutPath'] + '/' + self.release + '/' + self.arch if not os.path.exists(self.outPath): os.makedirs(self.outPath) self.candleNames = [ "TTbar_GEN,SIM,DIGI,L1,DIGI2RAW_NOPILEUP", "TTbar_GEN,FASTSIM_NOPILEUP", "TTbar_HLT_NOPILEUP", "TTbar_RAW2DIGI,RECO_NOPILEUP", "TTbar_GEN,SIM,DIGI,L1,DIGI2RAW_LowLumiPileUp", "TTbar_GEN,FASTSIM_LowLumiPileUp", "TTbar_HLT_LowLumiPileUp", "TTbar_RAW2DIGI,RECO_LowLumiPileUp", ] self.infoTypes = [ 'PerfTicks counts', 'PerfTicks calls', 'MEM_TOTAL counts', 'MEM_TOTAL calls', 'MEM_LIVE(mid) counts', 'MEM_LIVE(mid) calls', 'MEM_LIVE(end) counts', 'MEM_LIVE(end) calls' ]
def __init__(self, rel, arch='slc5_ia32_gcc434'): self.data = None self.release = rel self.arch = arch day, stamp, cyc = getStamp(self.release) self.cycle = cyc self.outPath = config.siteInfo['OutPath']+'/'+self.release+'/'+self.arch if not os.path.exists(self.outPath): os.makedirs(self.outPath) self.candleNames = ["TTbar_GEN,SIM,DIGI,L1,DIGI2RAW_NOPILEUP", "TTbar_GEN,FASTSIM_NOPILEUP", "TTbar_HLT_NOPILEUP", "TTbar_RAW2DIGI,RECO_NOPILEUP", "TTbar_GEN,SIM,DIGI,L1,DIGI2RAW_LowLumiPileUp", "TTbar_GEN,FASTSIM_LowLumiPileUp", "TTbar_HLT_LowLumiPileUp", "TTbar_RAW2DIGI,RECO_LowLumiPileUp", ] self.infoTypes = ['PerfTicks counts', 'PerfTicks calls', 'MEM_TOTAL counts', 'MEM_TOTAL calls', 'MEM_LIVE(mid) counts','MEM_LIVE(mid) calls', 'MEM_LIVE(end) counts','MEM_LIVE(end) calls' ]
def updateResults(self, dryRun=False): startDir = os.getcwd() os.chdir('newPerf-' + self.part) print 'revg> in', os.getcwd(), ' going to update results' for item in self.toDo: baseIn, xmlFileIn = os.path.split(item) base = baseIn.replace('newPerf-1of2/', '').replace('newPerf-2of2/', '') xmlFileFull = xmlFileIn.replace('_vlgd.xml', '_valgrind-1.xml') xmlFile = xmlFileIn.replace('_vlgd.xml', '_vlgd-1.xml') print xmlFileFull if not os.path.exists(os.path.join(base, xmlFileFull)): continue # ignore files which did not get redone # first convert the files to some manageable size cmd = 'cd ' + base + ';' cmd += 'xsltproc --output ' + xmlFile cmd += ' ' + scriptPath + '/filterOutValgrindLeakErrors.xsl ' + xmlFileFull try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when filtering XML file " + xmlFileFull + ' in ' + base print " got ", str(e) # then copy over the files to AFS: from helpers import getStamp try: cyc, day, stamp = getStamp(self.release) except Exception, e: print "revg> ERROR when trying to get cyc,day,stamp from release for ", self.release print " got :", str(e) cyc, day, stamp = ('none', 'none', 'none')
def main(): js = ''' <link rel="stylesheet" type="text/css" href="@HOST@/valgrind.css"> <!-- <style type="text/css"> @import url(css.css); </style> --> <style type="text/css"> .info { display: none; } </style> <script type="text/javascript" src="@HOST@/jsExt/jquery.js"></script> <script type="text/javascript"> function showHide(obj){ myname = obj.name; $(".detail[name='"+myname+"']").toggle(); $(".info[name='"+myname+"']").toggle(); } </script> <script type="text/javascript"> $(document).ready(function() { // make the "summary" and "hide summary" underlined $(".detail").css('text-decoration', "underline"); $(".info").css('text-decoration', "underline"); // color rows of tables alternatively for even/odd rows $("tr:even").css("background-color", 'rgb(234, 235, 255)'); $("tr:odd").css("background-color", 'rgb(211, 214, 255)'); // //for table stackFrame, select different colors for even/odd rows $("table.stackFrame tr:even").css("background-color", 'rgb(234, 235, 255)'); // "#ccffcc"); $("table.stackFrame tr:odd").css("background-color", 'rgb(211, 214, 255)'); // "#99ffff"); }); </script> <script type="text/javascript"> if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else // Internet Explorer 5/6 { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var xmlFileName="%s"; xhttp.open("GET",xmlFileName,false); xhttp.send(""); xmlDoc=xhttp.responseXML; document.write("<h2>Valgrind report for "+xmlFileName.split('/').pop()+"<\/h2>"); document.write("<h3>IB: %s<\/h3>"); String.prototype.entityify = function () { return this.replace(/&/g, "&").replace(/[<]/g, "<").replace(/[>]/g, ">"); } var x=xmlDoc.getElementsByTagName("error"); var docHasAux = 0; if (x.length > 0) { document.write("<h3>Found "+x.length+" errors in total.<\/h3>") document.write("<table border='1' cellpadding='3'>"); document.write("<tr>"); document.write("<td><b> # <\/b><\/td>"); document.write("<td><b> type <\/b><\/td>"); document.write("<td><b> detail #, lib, function <\/b><\/td>"); document.write("<\/tr>"); for (i=0;i<x.length;i++) { // loop all errors in doc document.write("<tr><td>"); document.write(i); document.write("<\/td><td>"); document.write(x[i].getElementsByTagName("what")[0].childNodes[0].nodeValue); document.write("<br/> <br/>"); if (x[i].getElementsByTagName("auxwhat").length > 0) { for (ia=0; ia<x[i].getElementsByTagName("auxwhat").length; ia++) { document.write(x[i].getElementsByTagName("auxwhat")[ia].childNodes[0].nodeValue); document.write("<br /> <br />"); } docHasAux = x[i].getElementsByTagName("auxwhat").length; } document.write("<\/td><td>"); document.write("<table class='stackFrame' border='0'>"); var sf = x[i].getElementsByTagName("stack")[0].getElementsByTagName("frame"); var details = ""; for (f=0;f<sf.length;f++) { libName = sf[f].getElementsByTagName("obj")[0].childNodes[0].nodeValue.split('/').pop(); fnNameRaw = sf[f].getElementsByTagName("fn")[0].childNodes[0].nodeValue; var fnName = String(fnNameRaw).entityify(); if ( sf[f].getElementsByTagName("dir").length > 0 ) { pathName = sf[f].getElementsByTagName("dir")[0].childNodes[0].nodeValue; fileName = sf[f].getElementsByTagName("file")[0].childNodes[0].nodeValue; lineName = sf[f].getElementsByTagName("line")[0].childNodes[0].nodeValue; while (lineName.length < 3) { lineName = '0'+lineName; } dirNames = pathName.split('/'); dirName = ""; for (id=dirNames.length-3; id<dirNames.length; id++) { dirName += dirNames[id]+'/'; } fnName += '<br /> <i>from: <a href="http://cmslxr.fnal.gov/lxr/source/'+dirName+fileName+'?v=%s'+'#'+lineName+'">'+dirName+fileName+" : "+lineName+'<\/a><\/i>'; } if (f == 0) { // write out the first row always, the other ones only on click row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } else { row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } } if (docHasAux > 0) { if (x[i].getElementsByTagName("stack").length > 0) { var auxs = x[i].getElementsByTagName("auxwhat"); for (ia=0; ia<docHasAux; ia++) { var emptyRow = "<tr><td colspan=3><hr /><\/td><\/tr>"; emptyRow += "<tr><td> <\/td><td> <b>Auxiliary information:<\/b> <\/td><td><b>"; emptyRow +=auxs[ia].childNodes[0].nodeValue; emptyRow +="<\/b><\/td><\/tr>"; document.write(emptyRow); var sf = x[i].getElementsByTagName("stack")[ia+1].getElementsByTagName("frame"); for (f=0;f<sf.length;f++) { libName = sf[f].getElementsByTagName("obj")[0].childNodes[0].nodeValue.split('/').pop(); fnNameRaw= sf[f].getElementsByTagName("fn")[0].childNodes[0].nodeValue; var fnName = String(fnNameRaw).entityify(); if ( sf[f].getElementsByTagName("dir").length > 0 ) { pathName = sf[f].getElementsByTagName("dir")[0].childNodes[0].nodeValue; fileName = sf[f].getElementsByTagName("file")[0].childNodes[0].nodeValue; lineName = sf[f].getElementsByTagName("line")[0].childNodes[0].nodeValue; while (lineName.length < 3) { lineName = '0'+lineName; } dirNames = pathName.split('/'); dirName = ""; for (id=dirNames.length-3; id<dirNames.length; id++) { dirName += dirNames[id]+'/'; } fnName += '<br /> <i>from: <a href="http://cmslxr.fnal.gov/lxr/source/'+dirName+fileName+'?v=%s'+'#'+lineName+'">'+dirName+fileName+" : "+lineName+'<\/a><\/i>'; } row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } // end for sf.length }// end for ia<docHasAux } } document.write("<\/table>"); document.write("<\/td><\/tr>"); } document.write("<\/table>"); } document.write("<p><\/p>"); </script> ''' js = js.replace('@HOST@', config.siteInfo['HtmlPath']) form = cgi.FieldStorage() ## cgi.print_form(form) txtOnly = form.has_key('txt') fmtr = SimpleHTMLFormatter(title='Valgrind report') # set some defaults scriptName = sys.argv[0] requestURI = '/'.join(sys.argv) try: scriptName = os.environ["SCRIPT_NAME"] requestURI = os.environ["REQUEST_URI"] except: pass pathReq = cleanPath(requestURI.replace(scriptName, '')) # reporter.info([pathReq]) topPath = config.siteInfo['qaPath'] topURL = config.siteInfo['OutHtml'] fullPath = topURL + os.path.normpath(pathReq) normPath = fullPath # fmtr.write( normPath,'<br/>' ) ib = normPath.split('/')[8] day, stamp, cycle = getStamp(ib) script = js % (normPath, ib, day.capitalize(), day.capitalize()) fmtr.addScriptCode(script) fmtr.write("") # dummy write to output script code ...
def runTests(self): self.release = helpers.getRelease(self.cycle) if not self.release: print "no release (yet) found for ", self.cycle return -2 self.releasePath = helpers.getReleasePath(self.release) if not os.path.exists(os.path.join(self.releasePath,'.SCRAM',self.plat)): return if not os.path.exists(os.path.join(self.releasePath,'installed.done')): return if os.path.exists(os.path.join(self.releasePath,'qaLogs.done')): return self.afsLogDir = os.path.join(self.releasePath, 'qaLogs') cycx, xday, self.stamp = helpers.getStamp(self.release) report='' print 'Running on %s machine(s)' % len(self.testBoxes) cmd0 = 'unset DISPLAY;export CMSINTBLD_CMS_PATH=%s;export SCRAM_ARCH=%s;' % (self.cmsPath,self.plat) self.buildDir = os.path.join(self.buildDir, self.release) usedHost = {} threadWeight = { 'relval+standard' : 8 , 'relval+highstats': 8 , 'autoBuild' : 4 , 'perfMatrix' : 3 , '1of2' : 8 , '2of2' : 8 , } self.prepare() self.fixJobNames(threadWeight) for item in self.only: tWeight = 1 # default: item has only one process try: tWeight = threadWeight[item] except: print "\n ==> found process with unknown threadWeight", item, '\n' actHost, usedHosts = self.getNextHost(tWeight) print '\nitem', item, 'acthost', actHost, 'used hosts = ', usedHosts, 'tWeight = ', tWeight cmd = cmd0 + self.buildDir+'/QA/runReleaseTests.py ' cmd += '--cycle ' + self.cycle + ' ' cmd += '--rel ' + self.release + ' ' cmd += '--build ' + self.buildDir + ' ' cmd += '--only ' + item + ' ' print '\nPreparing to run %s "%s" %s' % (self.buildDir, cmd, actHost) current = Tester(self.buildDir, cmd, actHost, tWeight, self.release, self.afsLogDir, item) self.threadList.append(current) current.start() time.sleep(random.randint(0,5)+5) # try to avoid race cond by sleeping random amount of time [5,10] sec # wait until all threads are finished activeThrd = self.activeThreads() while activeThrd > 0: time.sleep(10) aThrd = self.activeThreads() if aThrd != activeThrd: print "Waiting for "+str(aThrd)+" threads to finish" activeThrd = aThrd from publishQAResults import QAPublisher qap = QAPublisher(self.plat, self.release) qap.publishVGResults(self.afsLogDir) return
#except Exception, e: # print "revg> Error when scp-ing file ", os.path.join(base, xmlFile) # print " cmd '"+cmd+"'" # print " returned ", str(e) cmd = 'scp '+os.path.join(base, xmlFile) + ' vocms12:'+os.path.join(topDir, base.replace('newPerf-1of2/', '').replace('newPerf-2of2/', ''), xmlFile) try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when scp-ing file ", os.path.join(base, xmlFile) print " cmd '"+cmd+"'" print " returned ", str(e) # then copy over the log files as well : # ... to AFS: from helpers import getStamp cyc, day, stamp = getStamp(self.release) topDir = os.path.join('/afs/cern.ch/cms/sw/ReleaseCandidates/',os.environ['SCRAM_ARCH'], day, cyc+'-'+stamp, self.release, 'qaLogs') # GEN-DIGI2RAW/cpu5/TTbar_Memcheck/TTBAR__GEN-SIM-DIGI-L1-DIGI2RAW_memcheck_vlgd.xml ' logFileName = xmlFile.replace('_vlgd-1.xml','_valgrind.log').replace('-',',') cmd = 'cp ' + os.path.join(base,logFileName) + ' ' + os.path.join(topDir, base.replace('newPerf-1of2/', '').replace('newPerf-2of2/', ''), logFileName.replace('_valgrind.log','_valgrind-1.log')) try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when copying log file to AFS ", os.path.join(base, logFileName) print " got ", str(e) # ... and to the web (maybe this can be taken from AFS later): topDir = os.path.join('/data/intBld/incoming/', 'newPerf-'+self.part, os.environ['SCRAM_ARCH'], self.release, 'newPerf-'+self.part) logFileName = xmlFile.replace('_vlgd-1.xml','_valgrind.log').replace('-',',') # cmd = 'scp '+ os.path.join(base, logFileName) + ' vocms06:'+os.path.join(topDir, base.replace('newPerf-1of2/', '').replace('newPerf-2of2/', ''), logFileName.replace('_valgrind.log','_valgrind-1.log')) #try:
def readQASummary(self, build, day, plat): summPath = config.siteInfo['OutPath']+'/'+build+'/'+plat try: summFile = open(summPath+'/qaSummary.pkl', 'r') except IOError: # print "ERROR opening qaSummary pkl file "+summPath+'/qaSummary.pkl'+"<br/>" return [False, -1,-1,-1,-1,-1,-1,-1,-1,-1] pklr = Unpickler(summFile) vgErrs = int( pklr.load() ) igErrs = int( pklr.load() ) ddErr = pklr.load() cfgInfo = pklr.load() allDone = pklr.load() try: dfsErr = pklr.load() if type(dfsErr) == type ( (0,1) ): dfsErr = dfsErr[0]+dfsErr[1] except EOFError: dfsErr = -1 try: prodErr = int( pklr.load() ) except EOFError: prodErr = -1 try: fwliteErr = int( pklr.load() ) except EOFError: fwliteErr = -1 try: onlineErr = int( pklr.load() ) except EOFError: onlineErr = -1 summFile.close() cfgErr = 0 if cfgInfo[1] : cfgErr = len(cfgInfo[1]) # summary from the code rule checks ruleErrs = -1 import helpers wkDay, stamp, cycle = helpers.getStamp(build) crcSummPath = os.path.join(config.siteInfo['afsPath'], plat, 'www', day, cycle.replace('_','.')+'-'+stamp, build, 'codeRules' ) import glob gotInfo = False for crcFile in glob.glob(crcSummPath+'/cmsCodeRule*.dat'): try: crcSummFile = open(crcFile, 'r') pklr = Unpickler(crcSummFile) ruleErrs += len( pklr.load().keys() ) gotInfo = True crcSummFile.close() except: # self.formatter.write( "ERROR opening crcSummary pkl file "+crcSummPath+'/qaSummary.pkl'+"<br/>") ruleErrs = -1 gotInfo = False break if not gotInfo: # self.formatter.write("did not get info ... " + str(ruleErrs) ) ruleErrs = -1 return [allDone, vgErrs, igErrs, cfgErr, ddErr[0], dfsErr, ruleErrs, prodErr, fwliteErr, onlineErr]
base, xmlFile) + ' vocms12:' + os.path.join( topDir, base.replace('newPerf-1of2/', '').replace( 'newPerf-2of2/', ''), xmlFile) try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when scp-ing file ", os.path.join( base, xmlFile) print " cmd '" + cmd + "'" print " returned ", str(e) # then copy over the log files as well : # ... to AFS: from helpers import getStamp cyc, day, stamp = getStamp(self.release) topDir = os.path.join('/afs/cern.ch/cms/sw/ReleaseCandidates/', os.environ['SCRAM_ARCH'], day, cyc + '-' + stamp, self.release, 'qaLogs') # GEN-DIGI2RAW/cpu5/TTbar_Memcheck/TTBAR__GEN-SIM-DIGI-L1-DIGI2RAW_memcheck_vlgd.xml ' logFileName = xmlFile.replace('_vlgd-1.xml', '_valgrind.log').replace('-', ',') cmd = 'cp ' + os.path.join(base, logFileName) + ' ' + os.path.join( topDir, base.replace('newPerf-1of2/', '').replace('newPerf-2of2/', ''), logFileName.replace('_valgrind.log', '_valgrind-1.log')) try: doCmd(cmd, dryRun) except Exception, e: print "revg> Error when copying log file to AFS ", os.path.join( base, logFileName)
def main(): js = ''' <link rel="stylesheet" type="text/css" href="@HOST@/valgrind.css"> <!-- <style type="text/css"> @import url(css.css); </style> --> <style type="text/css"> .info { display: none; } </style> <script type="text/javascript" src="@HOST@/js/libs/jquery.min.js"></script> <script type="text/javascript"> function showHide(obj){ myname = obj.name; $(".detail[name='"+myname+"']").toggle(); $(".info[name='"+myname+"']").toggle(); } </script> <script type="text/javascript"> $(document).ready(function() { // make the "summary" and "hide summary" underlined $(".detail").css('text-decoration', "underline"); $(".info").css('text-decoration', "underline"); // color rows of tables alternatively for even/odd rows $("tr:even").css("background-color", 'rgb(234, 235, 255)'); $("tr:odd").css("background-color", 'rgb(211, 214, 255)'); // //for table stackFrame, select different colors for even/odd rows $("table.stackFrame tr:even").css("background-color", 'rgb(234, 235, 255)'); // "#ccffcc"); $("table.stackFrame tr:odd").css("background-color", 'rgb(211, 214, 255)'); // "#99ffff"); }); </script> <script type="text/javascript"> if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else // Internet Explorer 5/6 { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var xmlFileName="%s"; xhttp.open("GET",xmlFileName,false); xhttp.send(""); xmlDoc=xhttp.responseXML; document.write("<h2>Valgrind report for "+xmlFileName.split('/').pop()+"<\/h2>"); document.write("<h3>IB: %s<\/h3>"); String.prototype.entityify = function () { return this.replace(/&/g, "&").replace(/[<]/g, "<").replace(/[>]/g, ">"); } var x=xmlDoc.getElementsByTagName("error"); var docHasAux = 0; if (x.length > 0) { document.write("<h3>Found "+x.length+" errors in total.<\/h3>") document.write("<table border='1' cellpadding='3'>"); document.write("<tr>"); document.write("<td><b> # <\/b><\/td>"); document.write("<td><b> type <\/b><\/td>"); document.write("<td><b> detail #, lib, function <\/b><\/td>"); document.write("<\/tr>"); for (i=0;i<x.length;i++) { // loop all errors in doc document.write("<tr><td>"); document.write(i); document.write("<\/td><td>"); document.write(x[i].getElementsByTagName("what")[0].childNodes[0].nodeValue); document.write("<br/> <br/>"); if (x[i].getElementsByTagName("auxwhat").length > 0) { for (ia=0; ia<x[i].getElementsByTagName("auxwhat").length; ia++) { document.write(x[i].getElementsByTagName("auxwhat")[ia].childNodes[0].nodeValue); document.write("<br /> <br />"); } docHasAux = x[i].getElementsByTagName("auxwhat").length; } document.write("<\/td><td>"); document.write("<table class='stackFrame' border='0'>"); var sf = x[i].getElementsByTagName("stack")[0].getElementsByTagName("frame"); var details = ""; for (f=0;f<sf.length;f++) { libName = sf[f].getElementsByTagName("obj")[0].childNodes[0].nodeValue.split('/').pop(); fnNameRaw = sf[f].getElementsByTagName("fn")[0].childNodes[0].nodeValue; var fnName = String(fnNameRaw).entityify(); if ( sf[f].getElementsByTagName("dir").length > 0 ) { pathName = sf[f].getElementsByTagName("dir")[0].childNodes[0].nodeValue; fileName = sf[f].getElementsByTagName("file")[0].childNodes[0].nodeValue; lineName = sf[f].getElementsByTagName("line")[0].childNodes[0].nodeValue; while (lineName.length < 3) { lineName = '0'+lineName; } dirNames = pathName.split('/'); dirName = ""; for (id=dirNames.length-3; id<dirNames.length; id++) { dirName += dirNames[id]+'/'; } fnName += '<br /> <i>from: <a href="http://cmslxr.fnal.gov/lxr/source/'+dirName+fileName+'?v=%s'+'#'+lineName+'">'+dirName+fileName+" : "+lineName+'<\/a><\/i>'; } if (f == 0) { // write out the first row always, the other ones only on click row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } else { row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } } if (docHasAux > 0) { if (x[i].getElementsByTagName("stack").length > 0) { var auxs = x[i].getElementsByTagName("auxwhat"); for (ia=0; ia<docHasAux; ia++) { var emptyRow = "<tr><td colspan=3><hr /><\/td><\/tr>"; emptyRow += "<tr><td> <\/td><td> <b>Auxiliary information:<\/b> <\/td><td><b>"; emptyRow +=auxs[ia].childNodes[0].nodeValue; emptyRow +="<\/b><\/td><\/tr>"; document.write(emptyRow); var sf = x[i].getElementsByTagName("stack")[ia+1].getElementsByTagName("frame"); for (f=0;f<sf.length;f++) { libName = sf[f].getElementsByTagName("obj")[0].childNodes[0].nodeValue.split('/').pop(); fnNameRaw= sf[f].getElementsByTagName("fn")[0].childNodes[0].nodeValue; var fnName = String(fnNameRaw).entityify(); if ( sf[f].getElementsByTagName("dir").length > 0 ) { pathName = sf[f].getElementsByTagName("dir")[0].childNodes[0].nodeValue; fileName = sf[f].getElementsByTagName("file")[0].childNodes[0].nodeValue; lineName = sf[f].getElementsByTagName("line")[0].childNodes[0].nodeValue; while (lineName.length < 3) { lineName = '0'+lineName; } dirNames = pathName.split('/'); dirName = ""; for (id=dirNames.length-3; id<dirNames.length; id++) { dirName += dirNames[id]+'/'; } fnName += '<br /> <i>from: <a href="http://cmslxr.fnal.gov/lxr/source/'+dirName+fileName+'?v=%s'+'#'+lineName+'">'+dirName+fileName+" : "+lineName+'<\/a><\/i>'; } row = "<tr><td>"+f+"<\/td><td>"+libName+"<\/td><td>"+fnName+"<\/td><\/tr>"; document.write(row); } // end for sf.length }// end for ia<docHasAux } } document.write("<\/table>"); document.write("<\/td><\/tr>"); } document.write("<\/table>"); } document.write("<p><\/p>"); </script> ''' js = js.replace('@HOST@',config.siteInfo['HtmlPath']) form = cgi.FieldStorage() ## cgi.print_form(form) txtOnly = form.has_key('txt') fmtr = SimpleHTMLFormatter(title='Valgrind report') # set some defaults scriptName = sys.argv[0] requestURI = '/'.join(sys.argv) try: scriptName = os.environ["SCRIPT_NAME"] requestURI = os.environ["REQUEST_URI"] except: pass pathReq = cleanPath( requestURI.replace(scriptName,'') ) # reporter.info([pathReq]) topPath = config.siteInfo['qaPath'] topURL = config.siteInfo['OutHtml'] fullPath = topURL + os.path.normpath(pathReq) normPath = fullPath # fmtr.write( normPath,'<br/>' ) ib = normPath.split('/')[8] day, stamp, cycle = getStamp(ib) script = js % (normPath, ib, day.capitalize(), day.capitalize()) fmtr.addScriptCode(script) fmtr.write("") # dummy write to output script code ...
def runTests(self): self.release = helpers.getRelease(self.cycle) if not self.release: print "no release (yet) found for ", self.cycle return -2 self.releasePath = helpers.getReleasePath(self.release) if not os.path.exists( os.path.join(self.releasePath, '.SCRAM', self.plat)): return if not os.path.exists(os.path.join(self.releasePath, 'installed.done')): return if os.path.exists(os.path.join(self.releasePath, 'qaLogs.done')): return self.afsLogDir = os.path.join(self.releasePath, 'qaLogs') cycx, xday, self.stamp = helpers.getStamp(self.release) report = '' print 'Running on %s machine(s)' % len(self.testBoxes) cmd0 = 'unset DISPLAY;export CMSINTBLD_CMS_PATH=%s;export SCRAM_ARCH=%s;' % ( self.cmsPath, self.plat) self.buildDir = os.path.join(self.buildDir, self.release) usedHost = {} threadWeight = { 'relval+standard': 8, 'relval+highstats': 8, 'autoBuild': 4, 'perfMatrix': 3, '1of2': 8, '2of2': 8, } self.prepare() self.fixJobNames(threadWeight) for item in self.only: tWeight = 1 # default: item has only one process try: tWeight = threadWeight[item] except: print "\n ==> found process with unknown threadWeight", item, '\n' actHost, usedHosts = self.getNextHost(tWeight) print '\nitem', item, 'acthost', actHost, 'used hosts = ', usedHosts, 'tWeight = ', tWeight cmd = cmd0 + self.buildDir + '/QA/runReleaseTests.py ' cmd += '--cycle ' + self.cycle + ' ' cmd += '--rel ' + self.release + ' ' cmd += '--build ' + self.buildDir + ' ' cmd += '--only ' + item + ' ' print '\nPreparing to run %s "%s" %s' % (self.buildDir, cmd, actHost) current = Tester(self.buildDir, cmd, actHost, tWeight, self.release, self.afsLogDir, item) self.threadList.append(current) current.start() time.sleep( random.randint(0, 5) + 5 ) # try to avoid race cond by sleeping random amount of time [5,10] sec # wait until all threads are finished activeThrd = self.activeThreads() while activeThrd > 0: time.sleep(10) aThrd = self.activeThreads() if aThrd != activeThrd: print "Waiting for " + str(aThrd) + " threads to finish" activeThrd = aThrd from publishQAResults import QAPublisher qap = QAPublisher(self.plat, self.release) qap.publishVGResults(self.afsLogDir) return