示例#1
0
 def setUp(self):
     super(TestRunIssueMain, self).setUp()
     self.config = config.load_config(CONFIG_EXAMPLE)
     self.tdir = tempdir.TempDir()
     self.config['output_directory'] = self.tdir.name
     self.config_file = join(self.tdir.name, 'config.yaml')
     with open(self.config_file, 'w') as fh:
         yaml.dump(self.config, fh, default_flow_style=False)
     self.args += ['-c', self.config_file]
示例#2
0
def main():
    args = parse_args()
    c = config.load_config(args.config)
    job = scheduler.RedScheduler(c).Job.get(args.issueid)
    if args.rerun:
        sys.stdout.write('Overwriting existing directory {0}\n'.format(
            job.issue_dir
        ))
        shutil.rmtree(job.issue_dir)
    if not os.path.exists(job.issue_dir):
        try:
            job.run()
        except Exception as e:
            job.notes = str(e)
            job.statusname = 'Error'
            job.save()
            raise e
    else:
        sys.stderr.write('Refusing to overwrite existing directory {0}\n'.format(
            job.issue_dir
        ))
        return 17
示例#3
0
 def setUp(self):
     self.config = config.load_config(CONFIG_EXAMPLE)
     self.redscheduler = scheduler.RedScheduler(self.config)
     self.redscheduler.config = self.config
     super(JobResourceBase, self).setUp()
示例#4
0
 def setUp(self):
     self.config = config.load_config(CONFIG_EXAMPLE)
     self.redscheduler = scheduler.RedScheduler(self.config)
示例#5
0
 def setUp(self):
     self.config = config.load_config(CONFIG_EXAMPLE)
     self.redscheduler = scheduler.RedScheduler(self.config)
     self.redscheduler.config = self.config
     super(JobResourceBase,self).setUp()
示例#6
0
 def setUp(self):
     self.config = config.load_config(CONFIG_EXAMPLE)
     self.redscheduler = scheduler.RedScheduler(self.config)
示例#7
0
 def test_loads_config(self):
     r = config.load_config(CONFIG_EXAMPLE)
     keys = sorted(('siteurl', 'apikey', 'output_directory', 'job_defs'))
     self.assertEqual(keys, sorted(r.keys()))