* add note.

This commit is contained in:
wangyidong
2020-04-03 08:35:40 +08:00
parent 49d4d3dcc1
commit bbdef36c85
2 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -85,6 +85,7 @@ class ci extends control
*/
public function commitResult()
{
/* Get post data. */
$post = file_get_contents('php://input');
$post = json_decode($post);
@@ -94,6 +95,7 @@ class ci extends control
$zentaoData = zget($post, 'ZentaoData', '');
$frame = zget($post, 'TestFrame', 'junit');
/* Get compileID and jobID. */
parse_str($zentaoData, $params);
$this->loadModel('testtask');
$compileID = zget($params, 'compile', 0);
@@ -110,10 +112,11 @@ class ci extends control
if(empty($productID)) $productID = $compile->product;
if($compile->status != 'success' and $compile->status != 'fail' and $compile->status != 'create_fail' and $compile->status != 'timeout')
{
$this->loadModel('compile')->checkStatus($compile);
$this->loadModel('compile')->syncStatus($compile);
}
}
/* Get testtaskID or create testtask. */
if(!empty($taskID))
{
$testtask = $this->testtask->getById($taskID);
@@ -147,6 +150,8 @@ class ci extends control
}
if($compileID) $this->dao->update(TABLE_COMPILE)->set('testtask')->eq($taskID)->where('id')->eq($compileID)->exec();
/* Build data from case results. */
if($testType == 'unit')
{
$data = $this->testtask->buildDataFromUnit($post->UnitCaseResults, $frame, $productID, $jobID, $compileID);
+3 -3
View File
@@ -42,17 +42,17 @@ class ciModel extends model
->andWhere('t1.createdDate')->gt(date(DT_DATETIME1, strtotime("-1 day")))
->fetchAll();
foreach($compiles as $compile) $this->checkStatus($compile);
foreach($compiles as $compile) $this->syncStatus($compile);
}
/**
* Check status.
* Sync status.
*
* @param object $compile
* @access public
* @return void
*/
public function checkStatus($compile)
public function syncStatus($compile)
{
$jenkinsServer = $compile->url;
$jenkinsUser = $compile->account;