Esempio n. 1
0
class ReleaseTester(object):
    def __init__(self, releaseDir, dryRun=False):
        self.dryRun = dryRun
        self.plat = os.environ["SCRAM_ARCH"]
        self.appset = releaseDir + "/CMSDIST"
        self.cmsswBuildDir = releaseDir
        self.release = os.path.basename(releaseDir)
        self.relTag = self.release
        self.threadList = {}
        from cmsutils import getIBReleaseInfo
        self.relCycle, day, hour = getIBReleaseInfo(self.release)
        from logUpdater import LogUpdater
        self.logger = LogUpdater(self.cmsswBuildDir, self.dryRun)
        return

    # --------------------------------------------------------------------------------
    def getDepThreads(self, jobs=[]):
        deps = []
        for job in jobs:
            if job in self.threadList and self.threadList[job]:
                deps.append(self.threadList[job])
        return deps

    # --------------------------------------------------------------------------------
    def doTest(self, only=None):
        if not self.release:
            print("ReleaseTester> ERROR: no release specified !! ")
            return

        self.runProjectInit()
        if not only or 'dirsize' in only:
            print('\n' + 80 * '-' + ' dirsize \n')
            self.threadList['dirsize'] = self.runDirSize()

        if not only or 'depViolation' in only:
            print('\n' + 80 * '-' + ' depViolation \n')
            self.threadList['depViolation'] = self.runBuildFileDeps()

        if not only or 'relProducts' in only:
            print('\n' + 80 * '-' + ' relProducts \n')
            self.threadList['relProducts'] = self.runReleaseProducts()

        if not only or 'unit' in only:
            print('\n' + 80 * '-' + ' unit \n')
            self.threadList['unit'] = self.runUnitTests()

        # We only want to explicitly run this test.
        if only and 'gpu_unit' in only:
            print('\n' + 80 * '-' + ' gpu_unit \n')
            self.threadList['gpu_unit'] = self.runUnitTests([], 'GPU')

        if not only or 'codeRules' in only:
            print('\n' + 80 * '-' + ' codeRules \n')
            self.threadList['codeRules'] = self.runCodeRulesChecker()

        if not only or 'ignominy' in only:
            print('\n' + 80 * '-' + ' ignominy \n')
            self.threadList['ignominy'] = self.runIgnominy()

        if not only or 'fwbuildset' in only:
            print('\n' + 80 * '-' + ' FWLite BuildSet\n')
            self.threadList['fwbuildset'] = self.runFWLiteBuildSet(
                self.getDepThreads(['ignominy']))

        if not only or 'libcheck' in only:
            print('\n' + 80 * '-' + ' libcheck\n')
            self.threadList['libcheck'] = self.checkLibDeps()

        if not only or 'pyConfigs' in only:
            print('\n' + 80 * '-' + ' pyConfigs \n')
            self.threadList['pyConfigs'] = self.checkPyConfigs()

        if not only or 'dupDict' in only:
            print('\n' + 80 * '-' + ' dupDict \n')
            self.threadList['dupDict'] = self.runDuplicateDictCheck()

        print('TestWait> waiting for tests to finish ....')
        for task in self.threadList:
            if self.threadList[task]: self.threadList[task].join()
        print('TestWait> Tests finished ')
        return

    # --------------------------------------------------------------------------------
    def checkPyConfigs(self, deps=[]):
        print("Going to check python configs in ", os.getcwd())
        cmd = scriptPath + '/checkPyConfigs.py > chkPyConf.log 2>&1'
        try:
            doCmd(cmd, self.dryRun, self.cmsswBuildDir)
            self.logger.updateLogFile("chkPyConf.log")
            self.logger.updateLogFile("chkPyConf.log", 'testLogs')
        except:
            pass
        return None

    # --------------------------------------------------------------------------------
    def checkLibDeps(self, deps=[]):
        print("libDepTests> Going to run LibDepChk ... ")
        thrd = None
        try:
            thrd = LibDepsTester(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during LibDepChk : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runProjectInit(self, deps=[]):
        print("runProjectInit> Going regenerate scram caches ... ")
        try:
            ver = os.environ["CMSSW_VERSION"]
            cmd = "cd " + self.cmsswBuildDir + "; rm -rf src;"
            cmd += "curl -k -L -s -o src.tar.gz https://github.com/cms-sw/cmssw/archive/" + ver + ".tar.gz;"
            cmd += "tar -xzf src.tar.gz; mv cmssw-" + ver + " src; rm -rf src.tar.gz;"
            cmd += "mv src/Geometry/TrackerSimData/data src/Geometry/TrackerSimData/data.backup;"
            cmd += "scram build -r echo_CXX"
            doCmd(cmd)
        except Exception as e:
            print("ERROR during runProjectInit: caught exception: " + str(e))
        return None

    # --------------------------------------------------------------------------------
    def runCodeRulesChecker(self, deps=[]):
        print("runCodeRulesTests> Going to run cmsCodeRulesChecker ... ")
        thrd = None
        try:
            thrd = CodeRulesChecker(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during cmsCodeRulesChecker : caught exception: " +
                  str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runDuplicateDictCheck(self, deps=[]):
        print(
            "runDuplicateDictTests> Going to run duplicateReflexLibrarySearch.py ... "
        )
        script = 'duplicateReflexLibrarySearch.py'
        for opt in ['dup', 'lostDefs', 'edmPD']:
            cmd = script + ' --' + opt + ' 2>&1 >dupDict-' + opt + '.log'
            try:
                doCmd(cmd, self.dryRun, self.cmsswBuildDir)
            except Exception as e:
                print(
                    "ERROR during test duplicateDictCheck : caught exception: "
                    + str(e))
            self.logger.updateDupDictTestLogs()
        return None

    # --------------------------------------------------------------------------------
    def runIgnominy(self, deps=[]):
        print("ignominyTests> Going to run ignominy tests ... ")
        thrd = None
        try:
            thrd = IgnominyTests(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during run ignominytests : caught exception: " +
                  str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runFWLiteBuildSet(self, deps=[]):
        print("FWLiteBuildSet> Going to run FWLite BuildSet tests ... ")
        thd = None
        try:
            thd = AppBuildSetTests(self.cmsswBuildDir, self.logger,
                                   self.appset, deps, 'fwlite')
            thd.start()
        except Exception as e:
            print("ERROR during run FWLiteBuildSet : caught exception: " +
                  str(e))
        return thd

    # --------------------------------------------------------------------------------
    def runUnitTests(self, deps=[], xType=""):
        print("runTests> Going to run units tests ... ")
        thrd = None
        try:
            thrd = UnitTester(self.cmsswBuildDir, self.logger, deps, xType)
            thrd.start()
        except Exception as e:
            print("ERROR during run unittests : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runDirSize(self, deps=[]):
        print("runTests> Going to run DirSize ... ")
        thrd = None
        try:
            thrd = DirSizeTester(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during DirSize : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runReleaseProducts(self, deps=[]):
        print("runTests> Going to run ReleaseProducts ... ")
        thrd = None
        try:
            thrd = ReleaseProductsDump(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during ReleaseProducts : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runBuildFileDeps(self, deps=[]):
        print("runTests> Going to run BuildFileDeps ... ")
        thrd = None
        try:
            thrd = BuildFileDependencyCheck(self.cmsswBuildDir, self.logger,
                                            deps)
            thrd.start()
        except Exception as e:
            print("ERROR during RBuildFileDeps : caught exception: " + str(e))
        return thrd
Esempio n. 2
0
class ReleaseTester():

  def __init__(self, releaseDir, dryRun=False):
    self.dryRun = dryRun
    self.plat   = os.environ["SCRAM_ARCH"]
    self.appset = releaseDir+"/CMSDIST"
    self.cmsswBuildDir = releaseDir
    self.release = os.path.basename(releaseDir)
    self.relTag = self.release
    self.threadList = {}
    from cmsutils import getIBReleaseInfo
    self.relCycle,day,hour = getIBReleaseInfo(self.release)
    from logUpdater import LogUpdater
    self.logger = LogUpdater(self.cmsswBuildDir,self.dryRun)
    return
    
  # --------------------------------------------------------------------------------
  def getDepThreads(self, jobs=[]):
    deps = []
    for job in jobs:
      if self.threadList.has_key(job) and self.threadList[job]: deps.append(self.threadList[job])
    return deps

  # --------------------------------------------------------------------------------
  def doTest(self, only=None):
    if not self.release :
      print "ReleaseTester> ERROR: no release specified !! "
      return 

    self.runProjectInit()
    if not only or 'dirsize' in only:
      print '\n'+80*'-'+' dirsize \n'
      self.threadList['dirsize'] = self.runDirSize()

    if not only or 'depViolation' in only:
      print '\n'+80*'-'+' depViolation \n'
      self.threadList['depViolation'] = self.runBuildFileDeps()

    if not only or 'relProducts' in only:
      print '\n'+80*'-'+' relProducts \n'
      self.threadList['relProducts'] = self.runReleaseProducts()

    if not only or 'unit' in only:
      print '\n'+80*'-'+' unit \n'
      self.threadList['unit'] = self.runUnitTests()

    if not only or 'codeRules' in only:
      print '\n'+80*'-'+' codeRules \n'
      self.threadList['codeRules'] = self.runCodeRulesChecker()

    if not only or 'ignominy' in only:
      print '\n'+80*'-'+' ignominy \n'
      self.threadList['ignominy'] = self.runIgnominy()

    if not only or 'fwbuildset' in only:
      print '\n'+80*'-'+' FWLite BuildSet\n'
      self.threadList['fwbuildset'] = self.runFWLiteBuildSet(self.getDepThreads(['ignominy']))

    if not only or 'libcheck' in only:
      print '\n'+80*'-'+' libcheck\n'
      self.threadList['libcheck'] = self.checkLibDeps()

    if not only or 'pyConfigs' in only:
      print '\n'+80*'-'+' pyConfigs \n'
      self.threadList['pyConfigs'] = self.checkPyConfigs()

    if not only or 'dupDict' in only:
      print '\n'+80*'-'+' dupDict \n'
      self.threadList['dupDict'] = self.runDuplicateDictCheck()

    print 'TestWait> waiting for tests to finish ....'
    for task in self.threadList:
      if self.threadList[task]: self.threadList[task].join()
    print 'TestWait> Tests finished '
    return

  # --------------------------------------------------------------------------------
  def checkPyConfigs(self, deps = []):
    print "Going to check python configs in ", os.getcwd()
    cmd = scriptPath+'/checkPyConfigs.py > chkPyConf.log 2>&1'
    try:
      doCmd(cmd,self.dryRun,self.cmsswBuildDir)
      self.logger.updateLogFile("chkPyConf.log")
      self.logger.updateLogFile("chkPyConf.log",'testLogs')
    except:
      pass
    return None
    
  # --------------------------------------------------------------------------------
  def checkLibDeps(self, deps = []):
    print "libDepTests> Going to run LibDepChk ... "
    thrd = None
    try:
      thrd = LibDepsTester(self.cmsswBuildDir,self.logger, deps)
      thrd.start()
    except Exception, e :
      print "ERROR during LibDepChk : caught exception: " + str(e)
    return thrd
Esempio n. 3
0
class ReleaseTester(BuilderBase):
    def __init__(self, buildDir, releaseDir, appset, doInstall=True):

        BuilderBase.__init__(self)
        os.environ['STAGE_SVCCLASS'] = 't1transfer'
        os.environ['STAGE_HOST'] = 'castorcms'
        os.environ['STAGER_TRACE'] = '3'

        self.doInstall = doInstall
        self.buildDir = buildDir
        self.appset = appset
        self.updateTimeStamp(self.buildDir)

        self.cmsswBuildDir = releaseDir
        self.release = os.path.basename(releaseDir)
        self.relTag = self.release
        self.relCycle = self.release.replace("CMSSW_",
                                             "").split("_X_",
                                                       1)[0].replace("_", ".")

        day, hour = self.stamp.split('-')

        self.threadList = {}
        self.maxThreads = 2  # one for unit-tests, one for addOnTests

        self.doRelVal = True
        self.logger = None
        self.RelValArgs = None
        config.setDefaults(self.relCycle)
        try:
            self.doRelVal = config.Configuration[self.relCycle]['runRelVal']
            self.RelValArgs = config.Configuration[self.relCycle]['RelValArgs']
        except:
            pass

        return

    # --------------------------------------------------------------------------------

    def setupLogger(self, doInstall=True):

        if not self.logger:
            from logUpdater import LogUpdater
            self.logger = LogUpdater(self.buildDir, doInstall)
            self.logger.setDryRun(self.dryRun)
            self.logger.setRelease(self.relTag, self.relCycle, self.stamp)

        return

    # --------------------------------------------------------------------------------

    def getDepThreads(self, jobs=[]):
        deps = []
        for job in jobs:
            if self.threadList.has_key(job) and self.threadList[job]:
                deps.append(self.threadList[job])
        return deps

    # --------------------------------------------------------------------------------

    def doTest(self, only=None):

        if not self.release:
            print "ReleaseTester> ERROR: no release specified !! "
            return

        self.setupLogger(self.doInstall)
        self.runProjectInit()
        if not only or 'dirsize' in only:
            print '\n' + 80 * '-' + ' dirsize \n'
            self.threadList['dirsize'] = self.runDirSize()

        if not only or 'depViolation' in only:
            print '\n' + 80 * '-' + ' depViolation \n'
            self.threadList['ddepViolation'] = self.runBuildFileDeps()

        if not only or 'relProducts' in only:
            print '\n' + 80 * '-' + ' relProducts \n'
            self.threadList['relProducts'] = self.runReleaseProducts()

        if not only or 'addon' in only:
            print '\n' + 80 * '-' + ' addOnTests \n'
            self.threadList['addon'] = self.runAddOnTests()

        if not only or 'relvalcomp' in only:
            print '\n' + 80 * '-' + ' relvalcomp \n'
            self.threadList['relvalcomp'] = self.runBuildReports()

        if not only or 'unit' in only:
            print '\n' + 80 * '-' + ' unit \n'
            self.threadList['unit'] = self.runUnitTests()

        if not only or 'codeRules' in only:
            print '\n' + 80 * '-' + ' codeRules \n'
            self.threadList['codeRules'] = self.runCodeRulesChecker()

        if not only or 'ignominy' in only:
            print '\n' + 80 * '-' + ' ignominy \n'
            self.threadList['ignominy'] = self.runIgnominy()

        if not only or 'fwbuildset' in only:
            print '\n' + 80 * '-' + ' FWLite BuildSet\n'
            self.threadList['fwbuildset'] = self.runFWLiteBuildSet(
                self.getDepThreads(['ignominy']))

    #if not only or 'onlbuildset' in only:
    #    print '\n'+80*'-'+' Online BuildSet\n'
    #    self.threadList['onlbuildset'] = self.runOnlineBuildSet(self.getDepThreads(['ignominy']))

        if not only or 'dqmoffline' in only:
            print '\n' + 80 * '-' + ' DQMOfflineTest \n'
            self.threadList['dqmoffline'] = self.runDQMOfflineTests(
                self.getDepThreads(['unit']))

        if not only or 'relval' == only:
            print '\n' + 80 * '-' + ' relval \n'
            self.threadList['relval'] = self.runPyRelVals(
                self.getDepThreads(['addon']))

        if not only or 'libcheck' in only:
            print '\n' + 80 * '-' + ' libcheck\n'
            self.threadList['libcheck'] = self.checkLibDeps()

        if not only or 'geom' in only:
            print '\n' + 80 * '-' + ' geom \n'
            self.threadList['geom'] = self.runGeomTests()

        if not only or 'pyConfigs' in only:
            print '\n' + 80 * '-' + ' pyConfigs \n'
            self.threadList['pyConfigs'] = self.checkPyConfigs()

        if not only or 'dupDict' in only:
            print '\n' + 80 * '-' + ' dupDict \n'
            self.threadList['dupDict'] = self.runDuplicateDictCheck()

        print 'TestWait> waiting for tests to finish ....'
        for task in self.threadList:
            if self.threadList[task]: self.threadList[task].join()
        print 'TestWait> Tests finished '
        return

    # --------------------------------------------------------------------------------

    def checkPyConfigs(self, deps=[]):
        print "Going to check python configs in ", os.getcwd()
        cmd = 'cd src ; ' + scriptPath + '/checkPyConfigs.py > ../chkPyConf.log 2>&1'
        try:
            self.doCmd(cmd, self.dryRun, self.cmsswBuildDir)
            self.logger.updateLogFile("chkPyConf.log")
            self.logger.updateLogFile("chkPyConf.log", 'testLogs')
        except:
            pass
        return None

    # --------------------------------------------------------------------------------

    def checkLibDeps(self, deps=[]):
        print "libDepTests> Going to run LibDepChk ... "
        thrd = None
        try:
            thrd = LibDepsTester(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception, e:
            print "ERROR during LibDepChk : caught exception: " + str(e)
        return thrd
Esempio n. 4
0
class ReleaseTester(BuilderBase):

    def __init__(self, buildDir, releaseDir, appset, doInstall=True):

        BuilderBase.__init__(self)
        os.environ['STAGE_SVCCLASS']='t1transfer'
        os.environ['STAGE_HOST']='castorcms'
        os.environ['STAGER_TRACE']='3'
    
	self.doInstall=doInstall
	self.buildDir = buildDir
	self.appset = appset
	self.updateTimeStamp(self.buildDir)
	
	self.cmsswBuildDir = releaseDir
	self.release = os.path.basename(releaseDir)
	self.relTag = self.release
	self.relCycle = self.release.replace("CMSSW_","").split("_X_",1)[0].replace("_",".")
	
	day,hour = self.stamp.split('-')
        
        self.threadList = {}
        self.maxThreads = 2 # one for unit-tests, one for addOnTests

        self.doRelVal = True
        self.logger = None
        self.RelValArgs = None
        config.setDefaults(self.relCycle)
        try:
            self.doRelVal   = config.Configuration[self.relCycle]['runRelVal']
            self.RelValArgs = config.Configuration[self.relCycle]['RelValArgs']
        except:
            pass
	
        return
    
    # --------------------------------------------------------------------------------

    def setupLogger(self, doInstall=True):

        if not self.logger:
	    from logUpdater import LogUpdater
            self.logger = LogUpdater(self.buildDir,doInstall)
            self.logger.setDryRun(self.dryRun)
            self.logger.setRelease(self.relTag, self.relCycle, self.stamp)

        return
    # --------------------------------------------------------------------------------

    def getDepThreads(self, jobs=[]):
        deps = []
        for job in jobs:
            if self.threadList.has_key(job) and self.threadList[job]: deps.append(self.threadList[job])
        return deps

    # --------------------------------------------------------------------------------

    def doTest(self, only=None):

	if not self.release :
            print "ReleaseTester> ERROR: no release specified !! "
            return 

        self.setupLogger(self.doInstall)
        self.runProjectInit()
        if not only or 'dirsize' in only:
            print '\n'+80*'-'+' dirsize \n'
            self.threadList['dirsize'] = self.runDirSize()

        if not only or 'depViolation' in only:
            print '\n'+80*'-'+' depViolation \n'
            self.threadList['ddepViolation'] = self.runBuildFileDeps()

        if not only or 'relProducts' in only:
            print '\n'+80*'-'+' relProducts \n'
            self.threadList['relProducts'] = self.runReleaseProducts()

        if not only or 'addon' in only:
            print '\n'+80*'-'+' addOnTests \n'
            self.threadList['addon'] = self.runAddOnTests()

        if not only or 'relvalcomp' in only:
            print '\n'+80*'-'+' relvalcomp \n'
            self.threadList['relvalcomp'] = self.runBuildReports()

        if not only or 'unit' in only:
            print '\n'+80*'-'+' unit \n'
            self.threadList['unit'] = self.runUnitTests()

	if not only or 'codeRules' in only:
            print '\n'+80*'-'+' codeRules \n'
            self.threadList['codeRules'] = self.runCodeRulesChecker()

        if not only or 'ignominy' in only:
            print '\n'+80*'-'+' ignominy \n'
            self.threadList['ignominy'] = self.runIgnominy()

        if not only or 'fwbuildset' in only:
            print '\n'+80*'-'+' FWLite BuildSet\n'
            self.threadList['fwbuildset'] = self.runFWLiteBuildSet(self.getDepThreads(['ignominy']))

        #if not only or 'onlbuildset' in only:
        #    print '\n'+80*'-'+' Online BuildSet\n'
        #    self.threadList['onlbuildset'] = self.runOnlineBuildSet(self.getDepThreads(['ignominy']))

        if not only or 'dqmoffline' in only:
            print '\n'+80*'-'+' DQMOfflineTest \n'
            self.threadList['dqmoffline'] = self.runDQMOfflineTests(self.getDepThreads(['unit']))

        if not only or 'relval' == only:
            print '\n'+80*'-'+' relval \n'
            self.threadList['relval'] = self.runPyRelVals(self.getDepThreads(['addon']))

        if not only or 'libcheck' in only:
            print '\n'+80*'-'+' libcheck\n'
            self.threadList['libcheck'] = self.checkLibDeps()

        if not only or 'geom' in only:
            print '\n'+80*'-'+' geom \n'
            self.threadList['geom'] = self.runGeomTests()

        if not only or 'pyConfigs' in only:
            print '\n'+80*'-'+' pyConfigs \n'
            self.threadList['pyConfigs'] = self.checkPyConfigs()

        if not only or 'dupDict' in only:
            print '\n'+80*'-'+' dupDict \n'
            self.threadList['dupDict'] = self.runDuplicateDictCheck()

	print 'TestWait> waiting for tests to finish ....'
	for task in self.threadList:
            if self.threadList[task]: self.threadList[task].join()
        print 'TestWait> Tests finished '
	return
    
    # --------------------------------------------------------------------------------

    def checkPyConfigs(self, deps = []):
        print "Going to check python configs in ", os.getcwd()
        cmd = 'cd src ; '+scriptPath+'/checkPyConfigs.py > ../chkPyConf.log 2>&1'
        try:
            self.doCmd(cmd,self.dryRun,self.cmsswBuildDir)
	    self.logger.updateLogFile("chkPyConf.log")
	    self.logger.updateLogFile("chkPyConf.log",'testLogs')
        except:
            pass
        return None
    
    # --------------------------------------------------------------------------------

    def checkLibDeps(self, deps = []):
        print "libDepTests> Going to run LibDepChk ... "
        thrd = None
        try:
            thrd = LibDepsTester(self.cmsswBuildDir,self.logger, deps)
            thrd.start()
        except Exception, e :
            print "ERROR during LibDepChk : caught exception: " + str(e)
        return thrd
Esempio n. 5
0
class ReleaseTester(object):

    def __init__(self, releaseDir, dryRun=False):
        self.dryRun = dryRun
        self.plat = os.environ["SCRAM_ARCH"]
        self.appset = releaseDir + "/CMSDIST"
        self.cmsswBuildDir = releaseDir
        self.release = os.path.basename(releaseDir)
        self.relTag = self.release
        self.threadList = {}
        from cmsutils import getIBReleaseInfo
        self.relCycle, day, hour = getIBReleaseInfo(self.release)
        from logUpdater import LogUpdater
        self.logger = LogUpdater(self.cmsswBuildDir, self.dryRun)
        return

    # --------------------------------------------------------------------------------
    def getDepThreads(self, jobs=[]):
        deps = []
        for job in jobs:
            if job in self.threadList and self.threadList[job]: deps.append(self.threadList[job])
        return deps

    # --------------------------------------------------------------------------------
    def doTest(self, only=None):
        if not self.release:
            print("ReleaseTester> ERROR: no release specified !! ")
            return

        self.runProjectInit()
        if not only or 'dirsize' in only:
            print('\n' + 80 * '-' + ' dirsize \n')
            self.threadList['dirsize'] = self.runDirSize()

        if not only or 'depViolation' in only:
            print('\n' + 80 * '-' + ' depViolation \n')
            self.threadList['depViolation'] = self.runBuildFileDeps()

        if not only or 'relProducts' in only:
            print('\n' + 80 * '-' + ' relProducts \n')
            self.threadList['relProducts'] = self.runReleaseProducts()

        if not only or 'unit' in only:
            print('\n' + 80 * '-' + ' unit \n')
            self.threadList['unit'] = self.runUnitTests()

        # We only want to explicitly run this test.
        if only and 'gpu_unit' in only:
            print('\n' + 80 * '-' + ' gpu_unit \n')
            self.threadList['gpu_unit'] = self.runUnitTests([], 'GPU')

        if not only or 'codeRules' in only:
            print('\n' + 80 * '-' + ' codeRules \n')
            self.threadList['codeRules'] = self.runCodeRulesChecker()

        if not only or 'ignominy' in only:
            print('\n' + 80 * '-' + ' ignominy \n')
            self.threadList['ignominy'] = self.runIgnominy()

        if not only or 'fwbuildset' in only:
            print('\n' + 80 * '-' + ' FWLite BuildSet\n')
            self.threadList['fwbuildset'] = self.runFWLiteBuildSet(self.getDepThreads(['ignominy']))

        if not only or 'libcheck' in only:
            print('\n' + 80 * '-' + ' libcheck\n')
            self.threadList['libcheck'] = self.checkLibDeps()

        if not only or 'pyConfigs' in only:
            print('\n' + 80 * '-' + ' pyConfigs \n')
            self.threadList['pyConfigs'] = self.checkPyConfigs()

        if not only or 'dupDict' in only:
            print('\n' + 80 * '-' + ' dupDict \n')
            self.threadList['dupDict'] = self.runDuplicateDictCheck()

        print('TestWait> waiting for tests to finish ....')
        for task in self.threadList:
            if self.threadList[task]: self.threadList[task].join()
        print('TestWait> Tests finished ')
        return

    # --------------------------------------------------------------------------------
    def checkPyConfigs(self, deps=[]):
        print("Going to check python configs in ", os.getcwd())
        cmd = scriptPath + '/checkPyConfigs.py > chkPyConf.log 2>&1'
        try:
            doCmd(cmd, self.dryRun, self.cmsswBuildDir)
            self.logger.updateLogFile("chkPyConf.log")
            self.logger.updateLogFile("chkPyConf.log", 'testLogs')
        except:
            pass
        return None

    # --------------------------------------------------------------------------------
    def checkLibDeps(self, deps=[]):
        print("libDepTests> Going to run LibDepChk ... ")
        thrd = None
        try:
            thrd = LibDepsTester(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during LibDepChk : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runProjectInit(self, deps=[]):
        print("runProjectInit> Going regenerate scram caches ... ")
        try:
            ver = os.environ["CMSSW_VERSION"]
            cmd = "cd " + self.cmsswBuildDir + "; rm -rf src;"
            cmd += "curl -k -L -s -o src.tar.gz https://github.com/cms-sw/cmssw/archive/" + ver + ".tar.gz;"
            cmd += "tar -xzf src.tar.gz; mv cmssw-" + ver + " src; rm -rf src.tar.gz;"
            cmd += "mv src/Geometry/TrackerSimData/data src/Geometry/TrackerSimData/data.backup;"
            cmd += "scram build -r echo_CXX"
            doCmd(cmd)
        except Exception as e:
            print("ERROR during runProjectInit: caught exception: " + str(e))
        return None

    # --------------------------------------------------------------------------------
    def runCodeRulesChecker(self, deps=[]):
        print("runCodeRulesTests> Going to run cmsCodeRulesChecker ... ")
        thrd = None
        try:
            thrd = CodeRulesChecker(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during cmsCodeRulesChecker : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runDuplicateDictCheck(self, deps=[]):
        print("runDuplicateDictTests> Going to run duplicateReflexLibrarySearch.py ... ")
        script = 'duplicateReflexLibrarySearch.py'
        for opt in ['dup', 'lostDefs', 'edmPD']:
            cmd = script + ' --' + opt + ' 2>&1 >dupDict-' + opt + '.log'
            try:
                doCmd(cmd, self.dryRun, self.cmsswBuildDir)
            except Exception as e:
                print("ERROR during test duplicateDictCheck : caught exception: " + str(e))
            self.logger.updateDupDictTestLogs()
        return None

    # --------------------------------------------------------------------------------
    def runIgnominy(self, deps=[]):
        print("ignominyTests> Going to run ignominy tests ... ")
        thrd = None
        try:
            thrd = IgnominyTests(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during run ignominytests : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runFWLiteBuildSet(self, deps=[]):
        print("FWLiteBuildSet> Going to run FWLite BuildSet tests ... ")
        thd = None
        try:
            thd = AppBuildSetTests(self.cmsswBuildDir, self.logger, self.appset, deps, 'fwlite')
            thd.start()
        except Exception as e:
            print("ERROR during run FWLiteBuildSet : caught exception: " + str(e))
        return thd

    # --------------------------------------------------------------------------------
    def runUnitTests(self, deps=[], xType=""):
        print("runTests> Going to run units tests ... ")
        thrd = None
        try:
            thrd = UnitTester(self.cmsswBuildDir, self.logger, deps, xType)
            thrd.start()
        except Exception as e:
            print("ERROR during run unittests : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runDirSize(self, deps=[]):
        print("runTests> Going to run DirSize ... ")
        thrd = None
        try:
            thrd = DirSizeTester(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during DirSize : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runReleaseProducts(self, deps=[]):
        print("runTests> Going to run ReleaseProducts ... ")
        thrd = None
        try:
            thrd = ReleaseProductsDump(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during ReleaseProducts : caught exception: " + str(e))
        return thrd

    # --------------------------------------------------------------------------------
    def runBuildFileDeps(self, deps=[]):
        print("runTests> Going to run BuildFileDeps ... ")
        thrd = None
        try:
            thrd = BuildFileDependencyCheck(self.cmsswBuildDir, self.logger, deps)
            thrd.start()
        except Exception as e:
            print("ERROR during RBuildFileDeps : caught exception: " + str(e))
        return thrd