Optimise tests and coverage.

This commit is contained in:
James Cole
2018-05-13 09:01:10 +02:00
parent 528da3f08e
commit 1aae84a4d0
13 changed files with 154 additions and 106 deletions

View File

@@ -117,12 +117,9 @@ class JobStatusController extends Controller
{
// catch impossible status:
$allowed = ['ready_to_run', 'need_job_config'];
// todo remove error and running.
if (null !== $importJob && !\in_array($importJob->status, $allowed, true)) {
Log::error('Job is not ready.');
// kill the job:
$this->repository->setStatus($importJob, 'error');
return response()->json(['status' => 'NOK', 'message' => 'JobStatusController::start expects status "ready_to_run".']);
@@ -138,9 +135,6 @@ class JobStatusController extends Controller
// @codeCoverageIgnoreEnd
}
// set job to be running:
$this->repository->setStatus($importJob, 'running');
/** @var RoutineInterface $routine */
$routine = app($className);
$routine->setImportJob($importJob);