示例#1
0
 def test_all_status_covered(self):
     # ensure that all known status are returned. Test will fail if new status are added to PB
     all_statuses = set([
         RunStatus.RUNNING,
         RunStatus.SCHEDULED,
         RunStatus.FINISHED,
         RunStatus.FAILED,
         RunStatus.KILLED,
     ])
     self.assertSequenceEqual(all_statuses, set(RunStatus.all_status()))
示例#2
0
 def _create():
     run_id = str(uuid.uuid4())
     experiment_id = str(random_int(10, 2000))
     user_id = random_str(random_int(10, 25))
     status = RunStatus.to_string(random.choice(RunStatus.all_status()))
     start_time = random_int(1, 10)
     end_time = start_time + random_int(1, 10)
     lifecycle_stage = LifecycleStage.ACTIVE
     artifact_uri = random_str(random_int(10, 40))
     ri = RunInfo(run_uuid=run_id,
                  run_id=run_id,
                  experiment_id=experiment_id,
                  user_id=user_id,
                  status=status,
                  start_time=start_time,
                  end_time=end_time,
                  lifecycle_stage=lifecycle_stage,
                  artifact_uri=artifact_uri)
     return (ri, run_id, experiment_id, user_id, status, start_time,
             end_time, lifecycle_stage, artifact_uri)