diff --git a/test/class/gogs.class.php b/test/class/gogs.class.php new file mode 100644 index 0000000000..68d7c74435 --- /dev/null +++ b/test/class/gogs.class.php @@ -0,0 +1,88 @@ +tester = $tester; + $this->gogs = $this->tester->loadModel('gogs'); + } + + /** + * Get by id. + * + * @param int $id + * @access public + * @return object + */ + public function getByID($id) + { + $gogs = $this->gogs->getByID($id); + if(empty($gogs)) return 0; + return $gogs; + } + + /** + * Get gogs list. + * + * @param string $orderBy + * @access public + * @return object + */ + public function getList($orderBy = 'id_desc') + { + $gogs = $this->gogs->getList($orderBy); + if(empty($gogs)) return 0; + return array_shift($gogs); + } + + /** + * Get gogs pairs + * + * @return string + */ + public function getPairs() + { + $pairs = $this->gogs->getPairs(); + return key($pairs); + } + + /** + * Create a gogs. + * + * @access public + * @return object|string + */ + public function create() + { + $gogsID = $this->gogs->create(); + if(dao::isError()) + { + $errors = dao::getError(); + return key($errors); + } + + return $this->gogs->getById($gogsID); + } + + /** + * Update a gogs. + * + * @param int $id + * @access public + * @return object|string + */ + public function update($id) + { + $this->gogs->update($id); + if(dao::isError()) + { + $errors = dao::getError(); + return key($errors); + } + + return $this->gogs->getById($id); + } +} diff --git a/test/data/oauth.yaml b/test/data/oauth.yaml index 700ff499a0..cadcdfd2ac 100644 --- a/test/data/oauth.yaml +++ b/test/data/oauth.yaml @@ -10,8 +10,8 @@ fields: - field: account2 range: 3-100 - field: openID - range: 1-100 + range: 1-98,root{2} - field: providerType - range: gitlab + range: gitlab{98},gitea,gogs - field: providerID range: 1 diff --git a/test/data/pipeline.yaml b/test/data/pipeline.yaml index 14006cdefc..1e69ac16b3 100644 --- a/test/data/pipeline.yaml +++ b/test/data/pipeline.yaml @@ -3,24 +3,24 @@ author: Zeng gang version: "1.0" fields: - field: id - range: 1-4 + range: 1-5 - field: type - range: gitlab,sonarqube,jenkins,gitea + range: gitlab,sonarqube,jenkins,gitea,gogs - field: name - range: GitLab服务器,SonarQube服务器,Jenkins服务器,Gitea服务器 + range: GitLab服务器,SonarQube服务器,Jenkins服务器,Gitea服务器,Gogs服务器 - field: url - range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080],[http://10.0.7.242:9020] + range: [http://10.0.7.242:9980],[http://10.0.7.242:9990],[http://10.0.7.242:9580],[http://10.0.7.242:9020],[http://10.0.7.242:9021] - field: account - range: [],[admin]{2},[] + range: [],[admin]{2},[]{2} - field: password - range: [],[UDJzc3cwcmQ=],[RWFzeXNvZnRAcWQyMDEwIQ==],[] + range: [],[U2h3N0NldHlsc1ozYkVTVjBreXM=],[TThFbEJqcVZsNmJXcTdNSmJZN3U=],[]{2} - field: token - range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f + range: x88fZokrp5hShia2jyBN,YWRtaW46U2h3N0NldHlsc1ozYkVTVjBreXM=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f,9ff43f9d1a369465bcf0781a3785f46bcef782d1 - field: private - range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41,ada6cb0b0e59f4fb217bd8b75c844ac8 + range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41,a56af13f4c4a6a4ed77f24e59794cf39,4fabcbd31314365506ebc56c0c83c1ec - field: createdBy range: admin - field: createdDate - range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37],[2022-08-08 09:33:36] + range: [2022-08-01 09:09:37] - field: deleted range: 0 diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index d67e57308f..1dd6d8f647 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -109,12 +109,12 @@ $builder->weeklyreport = array('rows' => 10, 'extends' => array('weeklyreport')) $builder->metting = array('rows' => 10, 'extends' => array('meeting')); $builder->usertpl = array('rows' => 10, 'extends' => array('usertpl')); -$builder->pipeline = array('rows' => 4, 'extends' => array('pipeline')); +$builder->pipeline = array('rows' => 5, 'extends' => array('pipeline')); $builder->holiday = array('rows' => 100, 'extends' => array('holiday')); $builder->repo = array('rows' => 1, 'extends' => array('repo')); $builder->job = array('rows' => 2, 'extends' => array('job')); $builder->mr = array('rows' => 1, 'extends' => array('mr')); -$builder->oauth = array('rows' => 90, 'extends' => array('oauth')); +$builder->oauth = array('rows' => 100, 'extends' => array('oauth')); $builder->notify = array('rows' => 10, 'extends' => array('notify')); $builder->vm = array('rows' => 1, 'extends' => array('vm')); diff --git a/test/data/zt_repo.yaml b/test/data/zt_repo.yaml index 0c7d1a9c9f..0e189c2946 100644 --- a/test/data/zt_repo.yaml +++ b/test/data/zt_repo.yaml @@ -47,7 +47,7 @@ fields: format: "" - field: SCM note: "类型" - range: Subversion,Git + range: Subversion,Git,Gitlab,Gitea,Gogs prefix: "" postfix: "" loop: 0 @@ -59,6 +59,20 @@ fields: postfix: "" loop: 0 format: "" + - field: serviceHost + note: "服务器ID" + range: 0,0,1,4,5 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: serviceProject + note: "项目地址" + range: []{2},1569,root/repo121,root/yuyu_project + prefix: "" + postfix: "" + loop: 0 + format: "" - field: commits note: "提交数" range: 1-10000:R diff --git a/test/lib/db.class.php b/test/lib/db.class.php index c319649560..e0cc0cf622 100644 --- a/test/lib/db.class.php +++ b/test/lib/db.class.php @@ -143,7 +143,7 @@ class db { for($i = 1; $i <= $this->config->test->dbNum; $i++) { - $this->dao->query('DROP DATABASE ' . $this->config->test->dbPrefix . $i); + $this->dao->query('DROP DATABASE IF EXISTS ' . $this->config->test->dbPrefix . $i); $this->dao->query('CREATE DATABASE ' . $this->config->test->dbPrefix . $i); shell_exec("mysql -h{$this->config->db->host} -u {$this->config->db->user} -p{$this->config->db->password} -P {$this->config->db->port} {$this->config->test->dbPrefix}{$i} < {$this->sqlFile}"); diff --git a/test/lib/utils.php b/test/lib/utils.php index 2182360829..60e0f6a9d5 100755 --- a/test/lib/utils.php +++ b/test/lib/utils.php @@ -236,7 +236,7 @@ function copyDB() foreach($dbUsed as $db) { - if ($currentDBNum->num > 0) $dao->query('drop database ' . $db); + if($currentDBNum->num > 0) $dao->query('DROP DATABASE IF EXISTS ' . $db); $dao->query('CREATE DATABASE ' . $db); shell_exec("mysql -h{$config->db->host} -P {$config->db->port} -u{$config->db->user} -p{$config->db->password} $db < $sqlFile"); echo '数据库<' . $db . '>复制成功!' . PHP_EOL; diff --git a/test/model/gitea/checktokenaccess.php b/test/model/gitea/checktokenaccess.php new file mode 100644 index 0000000000..eca669c656 --- /dev/null +++ b/test/model/gitea/checktokenaccess.php @@ -0,0 +1,39 @@ +#!/usr/bin/env php +loadModel('gitea'); + +$host = ''; +$token = ''; + +$result = $gitea->checkTokenAccess($host, $token); +if($result === false) $result = 'return false'; +r($result) && p() && e('return false'); //使用空的数据验证token权限 + +$host = 'http://10.0.7.242:9020'; +$result = $gitea->checkTokenAccess($host, $token); +if(!$result) $result = 'return false'; +r($result) && p() && e('return false'); //使用错误的host验证token权限 + +$host = 'http://10.0.7.242:9020'; +$result = $gitea->checkTokenAccess($host, $token); +if(empty($result)) $result = 'return null'; +r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 + +$token = 'c6769e6761a7d719129b2421dcb3112d936e2b1f'; +$result = $gitea->checkTokenAccess($host, $token); +r($result) && p() && e('1'); //通过host,token验证token权限 + +$token = 'wVFHE6NZA-cJy-3U2y2J'; +$result = $gitea->checkTokenAccess($host, $token); +if(!isset($result->id)) $result = 'no access'; +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gitea/create.php b/test/model/gitea/create.php index 28e194950c..a701c1bf54 100644 --- a/test/model/gitea/create.php +++ b/test/model/gitea/create.php @@ -13,7 +13,7 @@ pid=1 Gitea名称为空 >> name 服务器地址为空 >> url -正确Gitea数据 >> Gitea,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d +正确Gitea数据 >> Gitea,http://10.0.7.242:9020,1196c85ba525a268570df9da627e3a7b2d */ diff --git a/test/model/gitea/update.php b/test/model/gitea/update.php index 6381206528..c33e0ae2ab 100644 --- a/test/model/gitea/update.php +++ b/test/model/gitea/update.php @@ -32,7 +32,7 @@ $_POST['name'] = 'Changed Gitea'; $_POST['url'] = ''; r($gitea->update($giteaID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9020'; r($gitea->update($giteaID)) && p('name') && e('Changed Gitea'); // 正确Gitea数据 $db->restoreDB(); diff --git a/test/model/gitlab/apigetcurrentuser.php b/test/model/gitlab/apigetcurrentuser.php index acf6f247ad..e4c465f3a3 100755 --- a/test/model/gitlab/apigetcurrentuser.php +++ b/test/model/gitlab/apigetcurrentuser.php @@ -30,14 +30,14 @@ $result = $gitlab->apiGetCurrentUser($host, $token); if(!$result) $result = 'return null'; r($result) && p() && e('return null'); //使用错误的host获取用户信息 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->apiGetCurrentUser($host, $token); r($gitlab->apiGetCurrentUser($host, $token)) && p('message') && e('401 Unauthorized'); //使用正确的host,错误的token获取用户信息 -$token = 'x88fZokrp5hShia2jyBN'; +$token = 'y2UBqwPPzaLxsniy8R6A'; $result = $gitlab->apiGetCurrentUser($host, $token); r($result) && p('id') && e('1'); //通过host,token获取用户信息 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->apiGetCurrentUser($host, $token); -r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 \ No newline at end of file +r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 diff --git a/test/model/gitlab/checktokenaccess.php b/test/model/gitlab/checktokenaccess.php index 2382aa49c4..641d8db5a2 100755 --- a/test/model/gitlab/checktokenaccess.php +++ b/test/model/gitlab/checktokenaccess.php @@ -30,7 +30,7 @@ $result = $gitlab->checkTokenAccess($host, $token); if(!$result) $result = 'return false'; r($result) && p() && e('return false'); //使用错误的host验证token权限 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->checkTokenAccess($host, $token); if(empty($result)) $result = 'return null'; r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 @@ -43,4 +43,4 @@ r($result) && p() && e('success'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->checkTokenAccess($host, $token); if(!isset($result->id)) $result = 'no access'; -r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 \ No newline at end of file +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gitlab/create.php b/test/model/gitlab/create.php index 98b43ccdfb..f698367593 100644 --- a/test/model/gitlab/create.php +++ b/test/model/gitlab/create.php @@ -12,7 +12,7 @@ pid=1 GitLab名称为空 >> name 服务器地址为空 >> url -正确GitLab数据 >> GitLab,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d +正确GitLab数据 >> GitLab,http://10.0.7.242:9980,1196c85ba525a268570df9da627e3a7b2d */ @@ -20,7 +20,7 @@ $gitlab = new gitlabTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -30,7 +30,7 @@ $_POST['name'] = 'GitLab'; $_POST['url'] = ''; r($gitlab->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; -r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.1.161:51080,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 +$_POST['url'] = 'http://10.0.7.242:9980'; +r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.7.242:9980,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/gitlab/update.php b/test/model/gitlab/update.php index 4006e3466d..7d3517c934 100644 --- a/test/model/gitlab/update.php +++ b/test/model/gitlab/update.php @@ -22,7 +22,7 @@ $gitlabID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['account'] = 'admin'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -33,7 +33,7 @@ $_POST['name'] = 'Changed GitLab'; $_POST['url'] = ''; r($gitlab->update($gitlabID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; r($gitlab->update($gitlabID)) && p('name') && e('Changed GitLab'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/gogs/checktokenaccess.php b/test/model/gogs/checktokenaccess.php new file mode 100644 index 0000000000..54b4d0dd4e --- /dev/null +++ b/test/model/gogs/checktokenaccess.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +loadModel('gogs'); + +$host = ''; +$token = ''; + +$result = $gogs->checkTokenAccess($host, $token); +if($result === false) $result = 'return false'; +r($result) && p() && e('return false'); //使用空的数据验证token权限 + +$host = 'http://10.0.7.242:9021'; +$result = $gogs->checkTokenAccess($host, $token); +if(!$result) $result = 'return false'; +r($result) && p() && e('return false'); //使用错误的host验证token权限 + +$host = 'http://10.0.7.242:9021'; +$result = $gogs->checkTokenAccess($host, $token); +if(empty($result)) $result = 'return null'; +r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 + +$token = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; +$result = $gogs->checkTokenAccess($host, $token); +if(isset($result->id)) $result = 'success'; +r($result) && p() && e('1'); //通过host,token验证token权限 + +$token = 'wVFHE6NZA-cJy-3U2y2J'; +$result = $gogs->checkTokenAccess($host, $token); +if(!isset($result->id)) $result = 'no access'; +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gogs/create.php b/test/model/gogs/create.php new file mode 100644 index 0000000000..457192d2f3 --- /dev/null +++ b/test/model/gogs/create.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->create(); +cid=1 +pid=1 + +Gogs名称为空 >> name +服务器地址为空 >> url +正确Gogs数据 >> Gogs,http://10.0.7.242:9021,9ff43f9d1a369465bcf0781a3785f46bcef782d1 + +*/ + +$gogs = new gogsTest(); + +$_POST = array(); +$_POST['name'] = ''; +$_POST['url'] = 'http://10.0.7.242:9021'; +$_POST['token'] = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; + +r($gogs->create()) && p() && e('name'); // Gogs名称为空 + +$_POST['name'] = 'Gogs'; +$_POST['url'] = ''; +r($gogs->create()) && p() && e('url'); // 服务器地址为空 + +$_POST['url'] = 'http://10.0.7.242:9021'; +r($gogs->create()) && p('name,url,token') && e('Gogs,http://10.0.7.242:9021,9ff43f9d1a369465bcf0781a3785f46bcef782d1'); // 正确Gogs数据 + +$db->restoreDB(); diff --git a/test/model/gogs/getbyid.php b/test/model/gogs/getbyid.php new file mode 100755 index 0000000000..73d5ce9d67 --- /dev/null +++ b/test/model/gogs/getbyid.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitById(); +cid=1 +pid=1 + +使用存在的ID >> 5 +使用空的ID >> 0 +使用不存在的ID >> 0 + +*/ + +$gogs = new gogsTest(); + +$gogsID = 5; +r($gogs->getById($gogsID)) && p('id') && e('5'); // 使用存在的ID + +$gogsID = 0; +r($gogs->getById($gogsID)) && p() && e(0); // 使用空的ID + +$gogsID = 111; +r($gogs->getById($gogsID)) && p() && e(0); // 使用不存在的ID + +$db->restoreDB(); diff --git a/test/model/gogs/getgogslistbyaccount.php b/test/model/gogs/getgogslistbyaccount.php new file mode 100644 index 0000000000..05727e94e0 --- /dev/null +++ b/test/model/gogs/getgogslistbyaccount.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +loadModel('gogs'); + +r(count($gogs->getGogsListByAccount())) && p() && e('0'); //默认admin用户查询绑定的gogs服务器 +r(count($gogs->getGogsListByAccount('user4'))) && p() && e('1'); //使用已绑定一个gogs服务器的用户查询 +r(count($gogs->getGogsListByAccount('test1'))) && p() && e('0'); //使用未绑定gogs服务器的用户查询 diff --git a/test/model/gogs/getlist.php b/test/model/gogs/getlist.php new file mode 100755 index 0000000000..8cd6deec9b --- /dev/null +++ b/test/model/gogs/getlist.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitList(); +cid=1 +pid=1 + +获取Gogs列表 >> 5 + +*/ + +$gogs = new gogsTest(); + +$orderBy = 'id_desc'; +r($gogs->getList($orderBy)) && p('id') && e('5'); // 获取Gogs列表 + +$db->restoreDB(); diff --git a/test/model/gogs/getpairs.php b/test/model/gogs/getpairs.php new file mode 100755 index 0000000000..ddd5ebe211 --- /dev/null +++ b/test/model/gogs/getpairs.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitPairs(); +cid=1 +pid=1 + +获取Gogs >> 5 + +*/ + +$gogs = new gogsTest(); + +r($gogs->getPairs()) && p() && e('5'); // 获取Gogs + +$db->restoreDB(); diff --git a/test/model/gogs/update.php b/test/model/gogs/update.php new file mode 100644 index 0000000000..5ba27752ce --- /dev/null +++ b/test/model/gogs/update.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->update(); +cid=1 +pid=1 + +Gogs名称为空 >> name +服务器地址为空 >> url +正确Gogs数据 >> Changed Gogs + +*/ + +$gogs = new gogsTest(); + +$gogsID = 3; + +$_POST = array(); +$_POST['name'] = ''; +$_POST['url'] = 'http://10.0.7.242:9021'; +$_POST['token'] = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; + +r($gogs->update($gogsID)) && p() && e('name'); // Gogs名称为空 + +$_POST['name'] = 'Changed Gogs'; +$_POST['url'] = ''; +r($gogs->update($gogsID)) && p() && e('url'); // 服务器地址为空 + +$_POST['url'] = 'http://10.0.7.242:9021'; +r($gogs->update($gogsID)) && p('name') && e('Changed Gogs'); // 正确Gogs数据 + +$db->restoreDB(); diff --git a/test/model/jenkins/create.php b/test/model/jenkins/create.php index cebc2d7076..853895bfe7 100755 --- a/test/model/jenkins/create.php +++ b/test/model/jenkins/create.php @@ -11,17 +11,13 @@ title=测试jenkinsModel->create(); cid=1 pid=1 -Jenkins名称为空 >> name -服务器地址为空 >> url -正确Jenkins数据 >> Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d - */ $jenkins = new jenkinsTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -32,7 +28,7 @@ $_POST['name'] = 'Jenkins'; $_POST['url'] = ''; r($jenkins->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; -r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 +$_POST['url'] = 'http://10.0.7.242:9580'; +r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.7.242:9580,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/model/jenkins/update.php b/test/model/jenkins/update.php index f8d0445b29..a51185f738 100755 --- a/test/model/jenkins/update.php +++ b/test/model/jenkins/update.php @@ -23,7 +23,7 @@ $jenkinsID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -34,7 +34,7 @@ $_POST['name'] = 'Changed Jenkins'; $_POST['url'] = ''; r($jenkins->update($jenkinsID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; r($jenkins->update($jenkinsID)) && p('name') && e('Changed Jenkins'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/ztest b/test/ztest index 57fb51373a..869ff5e444 100755 --- a/test/ztest +++ b/test/ztest @@ -190,6 +190,9 @@ switch($argv[1]) case 'gitea': ztfRun('model/gitea'); break; + case 'gogs': + ztfRun('model/gogs'); + break; case 'webhook': ztfRun('model/webhook'); break;