Пример #1
0
    def testA_Execute(self):
        """
        _Execute_

        Test the full path, including execute.
        """
        try:
            os.chdir(self.step.builder.workingDir)
            executor = CMSSWExecutor()
            executor.initialise(self.step, self.job)
            executor.pre()
            # Remove the scram pre-script as it requires an actual SCRAM environment
            executor.step.runtime.scramPreScripts.remove("SetupCMSSWPset")
            executor.execute()
            executor.post()
            # Check that there were no errors
            self.assertEqual(0, executor.report.getExitCode())
            # Check that we processed the XML
            self.assertEqual(2, len(executor.report.getAllFiles()))
            # Check that the executable was really executed
            self.assertTrue(os.path.isfile(os.path.join(self.step.builder.workingDir, "BogusFile.txt")))
        except Exception as ex:
            self.fail("Failure encountered, %s" % str(ex))
        finally:
            os.chdir(self.oldCwd)
        return
Пример #2
0
    def testA_Execute(self):
        """
        _Execute_

        Test the full path, including execute.
        """
        try:
            os.chdir(self.step.builder.workingDir)
            executor = CMSSWExecutor()
            executor.initialise(self.step, self.job)
            executor.pre()
            # Remove the scram pre-script as it requires an actual SCRAM environment
            executor.step.runtime.scramPreScripts.remove("SetupCMSSWPset")
            executor.execute()
            executor.post()
            # Check that there were no errors
            self.assertEqual(0, executor.report.getExitCode())
            # Check that we processed the XML
            self.assertEqual(2, len(executor.report.getAllFiles()))
            # Check that the executable was really executed
            self.assertTrue(
                os.path.isfile(
                    os.path.join(self.step.builder.workingDir,
                                 "BogusFile.txt")))
        except Exception as ex:
            self.fail("Failure encountered, %s" % str(ex))
        finally:
            os.chdir(self.oldCwd)
        return
Пример #3
0
    def testA_PrePost(self):
        """
        _PrePost_

        This test should run on any machine.
        It will simply make sure there are no major syntax errors or
        incompatibilities.

        It does not test the main functionality.
        """
        executor = CMSSWExecutor()
        executor.initialise(self.step, self.job)
        executor.pre()
        #executor.execute()
        executor.post()
        self.assertEqual(executor.report.data.ExecutorTest.status, 1)
        self.assertEqual(executor.report.data.ExecutorTest.analysis.files.fileCount, 0)
        return
Пример #4
0
    def testA_PrePost(self):
        """
        _PrePost_

        This test should run on any machine.
        It will simply make sure there are no major syntax errors or
        incompatibilities.

        It does not test the main functionality.
        """
        executor = CMSSWExecutor()
        executor.initialise(self.step, self.job)
        executor.pre()
        #executor.execute()
        executor.post()
        self.assertEqual(executor.report.data.ExecutorTest.status, 1)
        self.assertEqual(
            executor.report.data.ExecutorTest.analysis.files.fileCount, 0)
        return
Пример #5
0
    def testB_Execute(self):
        """
        _Execute_

        This test will only run where the scram setup can be done properly.

        To be honest it might have to be updated, but I don't know how.
        For now I'm skipping it.
        """

        executor = CMSSWExecutor()
        executor.initialise(self.step, self.job)
        executor.pre()
        try:
            executor.execute()
        except WMExecutionFailure:
            # This fails for me now
            # If it does so, just return
            return
        executor.post()

        print executor.report
        return
Пример #6
0
    def testB_Execute(self):
        """
        _Execute_

        This test will only run where the scram setup can be done properly.

        To be honest it might have to be updated, but I don't know how.
        For now I'm skipping it.
        """

        executor = CMSSWExecutor()
        executor.initialise(self.step, self.job)
        executor.pre()
        try:
            executor.execute()
        except WMExecutionFailure:
            # This fails for me now
            # If it does so, just return
            return
        executor.post()

        print executor.report
        return