diff --git a/module/ci/model.php b/module/ci/model.php index 9951cf7f1f..fc00953a5a 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -231,6 +231,7 @@ class ciModel extends model $pipeline = $this->loadModel('gitlab')->apiGetSinglePipeline($compile->server, $compile->project, $compile->queue); if(!isset($pipeline->id) || isset($pipeline->message)) /* The pipeline is not available. */ { + $this->dao->update(TABLE_COMPILE)->set('status')->eq('failure')->where('id')->eq($compile->id)->exec(); $this->dao->update(TABLE_JOB)->set('lastExec')->eq($now)->set('lastStatus')->eq('create_fail')->where('id')->eq($compile->job)->exec(); return false; } diff --git a/module/ci/test/model/synccompilestatus.php b/module/ci/test/model/synccompilestatus.php index a8e90299fd..01caa398e7 100755 --- a/module/ci/test/model/synccompilestatus.php +++ b/module/ci/test/model/synccompilestatus.php @@ -9,9 +9,9 @@ cid=1 - 同步jenkins构建结果属性status @created - 同步gitlab构建结果属性status @failed -- 三次请求没有拿到结果,构建失败属性status @failure +- 5次请求没有拿到结果,构建失败属性status @failure - 同步jenkins构建结果,有合并请求ID属性status @created -- 三次请求没有拿到结果,通知MR失败属性status @failure +- 5次请求没有拿到结果,通知MR失败属性status @failure */ @@ -26,10 +26,10 @@ su('admin'); libxml_use_internal_errors(true); $ci = new ciTest(); -r($ci->syncCompileStatusTest(1)) && p('status') && e('created'); // 同步jenkins构建结果 +r($ci->syncCompileStatusTest(1)) && p('status') && e('created'); // 同步jenkins构建结果 r($ci->syncCompileStatusTest(2)) && p('status') && e('failed'); // 同步gitlab构建结果 -r($ci->syncCompileStatusTest(4)) && p('status') && e('failure'); // 三次请求没有拿到结果,构建失败 +r($ci->syncCompileStatusTest(6)) && p('status') && e('failure'); // 5次请求没有拿到结果,构建失败 r($ci->syncCompileStatusTest(1, 1)) && p('status') && e('created'); // 同步jenkins构建结果,有合并请求ID -r($ci->syncCompileStatusTest(5, 1)) && p('status') && e('failure'); // 三次请求没有拿到结果,通知MR失败 +r($ci->syncCompileStatusTest(6, 1)) && p('status') && e('failure'); // 5次请求没有拿到结果,通知MR失败 diff --git a/module/ci/test/yaml/compile.yaml b/module/ci/test/yaml/compile.yaml index d0a6851600..ccd3f65b5a 100644 --- a/module/ci/test/yaml/compile.yaml +++ b/module/ci/test/yaml/compile.yaml @@ -18,4 +18,4 @@ fields: - field: tag range: release - field: times - range: 0,1-4 + range: 0,1-5