def success_rate(self): wpt_tasks = self.wpt_tasks if not wpt_tasks: return float(0) success = wpt_tasks.filter(tc.is_status_fn(tc.SUCCESS)) return float(len(success)) / len(wpt_tasks)
def validate(self): err = None if not len(self.wpt_tasks): err = ("No wpt tests found. Check decision task {}" % self.wpt_tasks.taskgroup.taskgroup_id) else: exception_tasks = self.wpt_tasks.filter(tc.is_status_fn(tc.EXCEPTION)) if float(len(exception_tasks)) / len(self.wpt_tasks) > (1 - self._min_success): err = ("Too many exceptions found among wpt tests. " "Check decision task %s" % self.wpt_tasks.taskgroup.taskgroup_id) if err: logger.error(err) return False return True
def validate_tasks(self): wpt_tasks = self.wpt_tasks() err = None if not len(wpt_tasks): err = "No wpt tests found. Check decision task {}".format( self.taskgroup_id) else: exception_tasks = wpt_tasks.filter(tc.is_status_fn(tc.EXCEPTION)) if float(len(exception_tasks)) / len(wpt_tasks) > ( 1 - self._min_success): err = ("Too many exceptions found among wpt tests. " "Check decision task {}".format(self.taskgroup_id)) if err: logger.error(err) self.infra_fail = True return False return True
def successful_builds(self): """Return the builds that were successful""" builds = self.wpt_tasks.filter(tc.is_build) return builds.filter(tc.is_status_fn({tc.SUCCESS}))
def failed_builds(self): builds = self.wpt_tasks().filter(tc.is_build) return builds.filter(tc.is_status_fn({tc.FAIL, tc.EXCEPTION}))