Commit 9d93321e authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

reduce coverage

parent f04dcb5d
......@@ -899,7 +899,7 @@ class JobManager(Manager):
log.info("start job %d (%s:%s)",
info.job_id, webapp.docker_name, info.version)
job.state = int(JobState.RUNNING)
job.state = int(JobState.RUNNING) # pragma: nobranch (TODO: remove (coverage bug))
repo = ctrl.gen_image_name(webapp)
......@@ -991,8 +991,8 @@ class JobManager(Manager):
exec_time =( parse_docker_timestamp(finished_at)
- parse_docker_timestamp(started_at)
).total_seconds()
except Exception:
log.exception("job %d: unable to compute exec time" % info.job_id)
except Exception: # pragma: nocover
log.exception("job %d: unable to compute exec time", info.job_id)
if tmp_img is None:
tmp_img = js["Config"]["Labels"].get("allgo.tmp_img") or None
......@@ -1028,7 +1028,7 @@ class JobManager(Manager):
with ses.begin():
# query db
job = ses.query(Job).filter_by(id=job_id).first()
if job is None:
if job is None: # pragma: nocover
# unknown job
log.warning("unknown job id %d", job_id)
return
......@@ -1081,7 +1081,7 @@ class JobManager(Manager):
return
info.ver_id = ver.id
elif state == JobState.RUNNING:
elif state == JobState.RUNNING: # pragma: nobranch
# job is already started
# we do not care about the actual version_id *but* we need to
......@@ -1094,7 +1094,7 @@ class JobManager(Manager):
except docker.errors.NotFound:
info.ctr_id = None
else:
else: # pragma: nocover
# unexpected state
log.warning("job id %d is in unexpected state %s", job_id, state.name)
return
......@@ -1113,7 +1113,7 @@ class JobManager(Manager):
yield from self.run_in_executor(self._create_job, info, lock=False)
yield from self._finish_job(info)
elif state == JobState.RUNNING:
elif state == JobState.RUNNING: # pragma: nobranch
# the job is already running
# -> wait for its termination
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment