class RegressionTestCase(IntegrationTest):
    """ Base class for the Regression test cases
  """
    def setUp(self):
        super(RegressionTestCase, self).setUp()

        self.diracLHCb = DiracLHCb()
        self.bkkClient = BookkeepingClient()

        exeScriptLoc = find_all('exe-script.py', '..',
                                '/LHCbDIRAC/tests/Workflow/Regression')[0]
        helloWorldLoc = find_all('helloWorld.py', '..',
                                 '/LHCbDIRAC/tests/Workflow/Regression')[0]

        shutil.copyfile(exeScriptLoc, './exe-script.py')
        shutil.copyfile(helloWorldLoc, './helloWorld.py')

        helloWorldXMLLocation = find_all(
            'helloWorld.xml', '..', '/LHCbDIRAC/tests/Workflow/Regression')[0]
        self.j_u_hello = LHCbJob(helloWorldXMLLocation)
        self.j_u_hello.setConfigArgs('pilot.cfg')

        helloWorldXMLFewMoreLocation = find_all(
            'helloWorld.xml', '..', '/LHCbDIRAC/tests/Workflow/Regression')[0]
        self.j_u_helloPlus = LHCbJob(helloWorldXMLFewMoreLocation)
        self.j_u_helloPlus.setConfigArgs('pilot.cfg')


#    self.j_u_collision12 = LHCbJob( 'collision12.xml' )
#    self.j_u_rootMerger = LHCbJob( 'rootMerger.xml' )

    def tearDown(self):
        os.remove('exe-script.py')
        os.remove('helloWorld.py')
Exemple #2
0
    def test_Regression_Production(self):

        location40651 = find_all('40651.xml', '..', 'Regression')[0]
        j_mc_40651 = LHCbJob(location40651)
        j_mc_40651.setConfigArgs('pilot.cfg')

        res = j_mc_40651.runLocal(self.diracLHCb)
        self.assertTrue(res['OK'])
  def test_Regression_Production(self):
    try:
      location66219 = find_all('66219.xml', os.environ['WORKSPACE'], '/LHCbDIRAC/tests/Workflow/Regression')[0]
    except (IndexError, KeyError):
      location66219 = find_all('66219.xml', rootPath, '/LHCbDIRAC/tests/Workflow/Regression')[0]

    j_mergeHISTO_66219 = LHCbJob(location66219)
    j_mergeHISTO_66219.setConfigArgs('pilot.cfg')

    res = j_mergeHISTO_66219.runLocal(self.diracLHCb)
    self.assertTrue(res['OK'])
Exemple #4
0
def __runJobLocally(jobID, basepath):
    """
  Runs the job!

  """
    from LHCbDIRAC.Interfaces.API.LHCbJob import LHCbJob
    localJob = LHCbJob(basepath + "InputSandbox" + str(jobID) + os.path.sep +
                       "jobDescription.xml")
    localJob.setInputSandbox(os.getcwd() + "pilot.cfg")
    localJob.setConfigArgs(os.getcwd() + "pilot.cfg")
    os.chdir(basepath)
    localJob.runLocal()
Exemple #5
0
    def test_Regression_Production(self):
        # Turbo Stripping Collision15em
        try:
            location46403 = find_all('46403.xml', os.environ['WORKSPACE'],
                                     '/LHCbDIRAC/tests/Workflow/Regression')[0]
        except (IndexError, KeyError):
            location46403 = find_all('46403.xml', rootPath,
                                     '/LHCbDIRAC/tests/Workflow/Regression')[0]

        j_stripp_46403 = LHCbJob(location46403)
        j_stripp_46403.setConfigArgs('pilot.cfg')

        res = j_stripp_46403.runLocal(self.diracLHCb)
        self.assertTrue(res['OK'])
Exemple #6
0
    def test_Regression_Production(self):
        # Reco from Reco17 #  FIXME: the input file is not there.
        try:
            location63284 = find_all('63284.xml', os.environ['WORKSPACE'],
                                     '/LHCbDIRAC/tests/Workflow/Regression')[0]
        except (IndexError, KeyError):
            location63284 = find_all('63284.xml', rootPath,
                                     '/LHCbDIRAC/tests/Workflow/Regression')[0]

        j_reco_63284 = LHCbJob(location63284)
        j_reco_63284.setConfigArgs('pilot.cfg')

        res = j_reco_63284.runLocal(self.diracLHCb)
        self.assertTrue(res['OK'])
Exemple #7
0
class UserJobTestCase(IntegrationTest):
    """ Base class for the UserJob test cases
  """
    def setUp(self):
        super(UserJobTestCase, self).setUp()

        print "\n \n ********************************* \n   Running a new test \n *********************************"

        self.dLHCb = DiracLHCb()
        try:
            self.exeScriptLocation = find_all('exe-script.py',
                                              os.environ['WORKSPACE'],
                                              '/tests/Workflow/Integration')[0]
        except (IndexError, KeyError):
            self.exeScriptLocation = find_all('exe-script.py', rootPath,
                                              '/tests/Workflow/Integration')[0]

        try:
            self.exeScriptFromDIRACLocation = find_all(
                'exe-script-fromDIRAC.py', os.environ['WORKSPACE'],
                '/tests/Workflow/Integration')[0]
        except (IndexError, KeyError):
            self.exeScriptFromDIRACLocation = find_all(
                'exe-script-fromDIRAC.py', rootPath,
                '/tests/Workflow/Integration')[0]
        self.lhcbJobTemplate = LHCbJob()
        self.lhcbJobTemplate.setLogLevel('DEBUG')
        try:
            # This is the standard location in Jenkins
            self.lhcbJobTemplate.setInputSandbox(
                find_all('pilot.cfg',
                         os.environ['WORKSPACE'] + '/PilotInstallDIR')[0])
        except (IndexError, KeyError):
            self.lhcbJobTemplate.setInputSandbox(
                find_all('pilot.cfg', rootPath)[0])
        self.lhcbJobTemplate.setConfigArgs('pilot.cfg')

    def tearDown(self):
        del self.lhcbJobTemplate
Exemple #8
0
def createJob(local=True):

    gaudirunJob = LHCbJob()

    gaudirunJob.setName("gaudirun-Gauss-test")
    if local:
        try:
            gaudirunJob.setInputSandbox([
                find_all('prodConf_Gauss_00012345_00067890_1.py',
                         os.environ['WORKSPACE'],
                         '/tests/System/GridTestSubmission')[0],
                find_all('wrongConfig.cfg', os.environ['WORKSPACE'],
                         '/tests/System/GridTestSubmission')[0],
                find_all('pilot.cfg',
                         os.environ['WORKSPACE'] + '/PilotInstallDIR')[0]
            ])
        except (IndexError, KeyError):
            gaudirunJob.setInputSandbox([
                find_all('prodConf_Gauss_00012345_00067890_1.py', rootPath,
                         '/tests/System/GridTestSubmission')[0],
                find_all('wrongConfig.cfg', rootPath,
                         '/tests/System/GridTestSubmission')[0],
                find_all('pilot.cfg', rootPath)[0]
            ])
    else:
        try:
            gaudirunJob.setInputSandbox([
                find_all('prodConf_Gauss_00012345_00067890_1.py',
                         os.environ['WORKSPACE'],
                         '/tests/System/GridTestSubmission')[0],
                find_all('wrongConfig.cfg', os.environ['WORKSPACE'],
                         '/tests/System/GridTestSubmission')[0]
            ])
        except (IndexError, KeyError):
            gaudirunJob.setInputSandbox([
                find_all('prodConf_Gauss_00012345_00067890_1.py', rootPath,
                         '/tests/System/GridTestSubmission')[0],
                find_all('wrongConfig.cfg', rootPath,
                         '/tests/System/GridTestSubmission')[0]
            ])

    gaudirunJob.setOutputSandbox('00012345_00067890_1.sim')

    optGauss = "$APPCONFIGOPTS/Gauss/Sim08-Beam3500GeV-md100-2011-nu2.py;"
    optDec = "$DECFILESROOT/options/34112104.py;"
    optPythia = "$LBPYTHIAROOT/options/Pythia.py;"
    optOpts = "$APPCONFIGOPTS/Gauss/G4PL_FTFP_BERT_EmNoCuts.py;"
    optCompr = "$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py;"
    optPConf = "prodConf_Gauss_00012345_00067890_1.py"
    options = optGauss + optDec + optPythia + optOpts + optCompr + optPConf

    gaudirunJob.setApplication(
        'Gauss',
        'v45r5',
        options,
        extraPackages='AppConfig.v3r171;Gen/DecFiles.v27r14p1;ProdConf.v1r9',
        systemConfig='x86_64-slc5-gcc43-opt',
        modulesNameList=[
            'CreateDataFile', 'GaudiApplication', 'FileUsage',
            'UploadOutputData', 'UploadLogFile', 'FailoverRequest',
            'UserJobFinalization'
        ],
        parametersList=[('applicationName', 'string', '', 'Application Name'),
                        ('applicationVersion', 'string', '',
                         'Application Version'),
                        ('applicationLog', 'string', '',
                         'Name of the output file of the application'),
                        ('optionsFile', 'string', '', 'Options File'),
                        ('extraOptionsLine', 'string', '',
                         'This is appended to standard options'),
                        ('inputDataType', 'string', '', 'Input Data Type'),
                        ('inputData', 'string', '', 'Input Data'),
                        ('numberOfEvents', 'string', '', 'Events treated'),
                        ('extraPackages', 'string', '', 'ExtraPackages'),
                        ('listoutput', 'list', [], 'StepOutputList'),
                        ('SystemConfig', 'string', '', 'binary tag')])

    gaudirunJob._addParameter(gaudirunJob.workflow, 'PRODUCTION_ID', 'string',
                              '00012345', 'ProductionID')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'JOB_ID', 'string',
                              '00067890', 'JobID')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'configName', 'string',
                              'testCfg', 'ConfigName')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'configVersion', 'string',
                              'testVer', 'ConfigVersion')
    outputList = [{
        'stepName': 'GaussStep1',
        'outputDataType': 'sim',
        'outputBKType': 'SIM',
        'outputDataSE': 'Tier1_MC-DST',
        'outputDataName': '00012345_00067890_1.sim'
    }]
    gaudirunJob._addParameter(gaudirunJob.workflow, 'outputList', 'list',
                              outputList, 'outputList')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'outputDataFileMask',
                              'string', '', 'outputFM')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'outputMode', 'string',
                              'Local', 'OM')
    gaudirunJob._addParameter(gaudirunJob.workflow, 'LogLevel', 'string',
                              'DEBUG', 'LL')
    outputFilesDict = [{
        'outputDataName': '00012345_00067890_1.sim',
        'outputDataSE': 'Tier1_MC-DST',
        'outputDataType': 'SIM'
    }]
    gaudirunJob._addParameter(gaudirunJob.workflow.step_instances[0],
                              'listoutput', 'list', outputFilesDict,
                              'listoutput')

    gaudirunJob.setLogLevel('DEBUG')
    gaudirunJob.setDIRACPlatform()
    if local:
        gaudirunJob.setConfigArgs('pilot.cfg wrongConfig.cfg')
    else:
        gaudirunJob.setConfigArgs('wrongConfig.cfg')

    gaudirunJob.setCPUTime(172800)

    return gaudirunJob