Exemple #1
0
 def to_jsonjob(self):
     return rest.BadpennyJob(id=self.id,
                             task_name=self.task.name,
                             created_at=self.created_at,
                             started_at=self.started_at,
                             completed_at=self.completed_at,
                             successful=self.successful)
Exemple #2
0
    session.commit()
    return l


def insert_task(app, name):
    session = app.db.session('relengapi')
    t = tables.BadpennyTask(name=name)
    session.add(t)
    session.commit()
    return t


cleanup_task = rest.BadpennyTask(active=False, name="cleanup", last_success=0)
cleanup_job_1 = rest.BadpennyJob(id=1,
                                 successful=True,
                                 task_name='cleanup',
                                 created_at=dt(1978, 6, 15),
                                 started_at=dt(1978, 6, 15, 12),
                                 completed_at=dt(1978, 6, 15, 13))
cleanup_job_2 = rest.BadpennyJob(id=2,
                                 successful=False,
                                 task_name='cleanup',
                                 created_at=dt(1978, 6, 16),
                                 started_at=dt(1978, 6, 16, 12),
                                 completed_at=dt(1978, 6, 16, 13))

report_task = rest.BadpennyTask(active=False, name="report", last_success=1)
report_job_1 = rest.BadpennyJob(id=3,
                                successful=True,
                                task_name='report',
                                created_at=dt(1978, 6, 2),
                                started_at=dt(1978, 6, 2, 12),