How to use the gc3pie.gc3apps.run_test_apps.TestRunner function in gc3pie

To help you get started, we’ve selected a few gc3pie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
examfile = os.path.join(self.output_dir, 'exam01', 'exam01.out')
        if not os.path.isfile(examfile):
            self.passed = False
        stdout = read_contents(examfile)

        if re.match('.*\n (EXECUTION OF GAMESS TERMINATED NORMALLY).*',
                    stdout, re.M | re.S):
            self.passed = True
        else:
            gc3libs.log.error(
                "GGamess: Output file %s does not match success regexp",
                examfile)
            self.passed = False


class GGeotopTest(TestRunner, Application):
    def __str__(self):
        return "GGeotop"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        Application.__init__(
            self,
            arguments=['./ggeotop.py'] + self.stdargs \
                + ['-x', 'geotop_1_224_20120227_static',
                   'GEOtop_public_test'],
            inputs=[
                os.path.join(self.appdir, name) for name in
                ['ggeotop.py',
                 'test/geotop_1_224_20120227_static',
                 'test/data/GEOtop_public_test']],
            outputs=['GEOtop_public_test/out'],
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
arguments=['./ggeotop.py'] + self.stdargs \
                + ['-x', 'geotop_1_224_20120227_static',
                   'GEOtop_public_test'],
            inputs=[
                os.path.join(self.appdir, name) for name in
                ['ggeotop.py',
                 'test/geotop_1_224_20120227_static',
                 'test/data/GEOtop_public_test']],
            outputs=['GEOtop_public_test/out'],
            **kw)

    def terminated(self):
        self.passed = os.path.isdir(os.path.join(self.output_dir, 'out'))


class GZodsTest(TestRunner, Application):
    def __str__(self):
        return "GZods"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        Application.__init__(
            self,
            arguments=['./gzods.py'] + self.stdargs + ['small'],
            inputs=[
                os.path.join(self.appdir, i) for i in [
                    'gzods.py', 'test/data/small']],
            outputs=['small', 'input'],
            **kw)

    def terminated(self):
        if self.execution._exitcode == 0:
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        Application.__init__(
            self,
            arguments = ['./gc_gps.py']  + self.stdargs + ['small.txt', 'src', '-i', 'in', '-o', 'out'],
            inputs = [
                os.path.join(self.appdir, name) for name in
                ('gc_gps.py', 'test-gc_gps/small.txt', 'test-gc_gps/src', 'test-gc_gps/in')],
            outputs=['out'],
            **kw)

    def terminated(self):
        self.passed = self.execution._exitcode == 0


class GCryptoTest(TestRunner, Application):
    def __str__(self):
        return "GCrypto"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)

        args = ['/bin/true']
        ifiles = [os.path.join(self.appdir, 'gcrypto.py'),
                  os.path.join(self.testdir, 'input.tgz'),
                  os.path.join(self.testdir, 'gnfs-cmd_20120406'),
                  ]
        if os.path.isdir(self.testdir) \
                and min(os.path.isfile(f) for f in ifiles):
            # input files found. Run gcrypto test.
            args = [
                './gcrypto.py',
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
`tests` is a list of subdirectories which must match the
        `RunTestsInParallel` dictionary
        """
        if not tests:
            tests = self.applicationdirs
        else:
            tests = dict((k, v) for k, v in self.applicationdirs.iteritems()
                         if k in tests)
        tasks = []
        extra['output_dir'] = "RunTestAppsInParallel"
        for testdir, classes in tests.iteritems():
            appdir = os.path.abspath(testdir)

            tasks += [
                cls(appdir, **extra) for cls in classes
                if issubclass(cls, Task) and issubclass(cls, TestRunner)]
        if not tasks:
            raise RuntimeError("No tasks found")
        ParallelTaskCollection.__init__(self, tasks, **extra)
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
self.stdargs = ['-s', 'TEST_SESSION',
                        '-r', kw['resource'],
                        '-C', '45',
                        '-vvvv']

    def compatible_resources(self, resources):
        shellcmd = [r for r in resources if isinstance(r, ShellcmdLrms)]
        shellcmd_local = [r for r in shellcmd if
                          isinstance(r.transport, LocalTransport)]
        if shellcmd_local:
            return shellcmd_local
        else:
            return shellcmd


class GCodemlTest(TestRunner, Application):
    def __str__(self):
        return "GCodeml"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        self.datadir = os.path.join(self.testdir, 'data/small_flat')
        Application.__init__(
            self,
            arguments=['./gcodeml.py'] +
            self.stdargs + ['small_flat'],
            inputs=[
                os.path.join(self.appdir, 'gcodeml.py'),
                self.datadir],
            outputs=['small_flat.out'],
            **kw)
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
TestRunner.__init__(self, appdir, kw)
        Application.__init__(
            self,
            arguments=['./gzods.py'] + self.stdargs + ['small'],
            inputs=[
                os.path.join(self.appdir, i) for i in [
                    'gzods.py', 'test/data/small']],
            outputs=['small', 'input'],
            **kw)

    def terminated(self):
        if self.execution._exitcode == 0:
            self.passed = True


class GRosettaTest(TestRunner, Application):
    def __str__(self):
        return "GRosetta"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        self.jobdirs = ['0--1', '2--3', '4--5']
        kw['output_dir'] = os.path.join(
            os.path.dirname(kw['output_dir']), 'rosetta')

        Application.__init__(
            self,
            arguments=['./grosetta.py'] + self.stdargs \
                + ['--total-decoys', '5',
                   '--decoys-per-job', '2',
                   'data/grosetta.flags',
                   'data/alignment.filt',
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
for jobdir in self.jobdirs:
            if not os.path.isdir(jobdir):
                gc3libs.log.error(
                    "GDocking: missing job directory %s" % jobdir)
                self.passed = False
                return
            outfile = os.path.join(jobdir, 'docking_protocol.stdout.txt')

            if not os.path.isfile(outfile):
                gc3libs.log.error(
                    "GDocking: missing output file %s" % outfile)
                self.passed = False
                return
        self.passed = True

class GGcGpsTest(TestRunner, Application):
    def __str__(self):
        return "GGcGps"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        Application.__init__(
            self,
            arguments = ['./gc_gps.py']  + self.stdargs + ['small.txt', 'src', '-i', 'in', '-o', 'out'],
            inputs = [
                os.path.join(self.appdir, name) for name in
                ('gc_gps.py', 'test-gc_gps/small.txt', 'test-gc_gps/src', 'test-gc_gps/in')],
            outputs=['out'],
            **kw)

    def terminated(self):
        self.passed = self.execution._exitcode == 0
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
'minirosetta.static: All done, exitcode: 0':
                    gc3libs.log.error(
                        "GRosetta: expecting different output in `%s`. "
                        "Last line is: `%s`", outfile, output[-1])
                    self.passed = False
                    return
            except Exception, ex:
                gc3libs.log.error(
                    "GRosetta: Error while checking exit status of `grosetta`:"
                    " %s", str(ex))
                self.passed = False
                raise ex
        self.passed = True


class GDockingTest(TestRunner, Application):
    def __str__(self):
        return "GDocking"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)
        kw['output_dir'] = os.path.join(
            os.path.dirname(kw['output_dir']), 'docking')

        self.jobdirs = ["1bjpA.%s" % d for d in ('1--2', '3--4', '5--5')]
        Application.__init__(
            self,
            arguments=['./gdocking.py'] + self.stdargs \
                + ['--decoys-per-file', '5',
                   '--decoys-per-job', '2',
                   '-f', 'data/gdocking.flags',
                   'data/1bjpA.pdb',
github gc3pie / gc3pie / gc3pie / gc3apps / run_test_apps.py View on Github external
outfile)
                    self.passed = False
                    return
                fd = open(outfile)
                output = fd.readlines()
                fd.close()
                if not output or not output[-1].startswith("Time used:"):
                    gc3libs.log.error("GCodeml: Error in output file `%s`",
                                      outfile)
                    self.passed = False
                    return

        self.passed = True


class GGamessTest(TestRunner, Application):
    def __str__(self):
        return "GGamess"

    def __init__(self, appdir, **kw):
        TestRunner.__init__(self, appdir, kw)

        Application.__init__(
            self,
            arguments=['./ggamess.py'] + self.stdargs + ['-R', '2012R1',
                                                         'exam01.inp'],
            inputs=[os.path.join(self.appdir, 'ggamess.py'),
                    os.path.join(self.appdir, 'test/data/exam01.inp')],
            outputs=['exam01'],
            **kw)

    def terminated(self):