* Adjust pipeline unit test check rule.

This commit is contained in:
caoyanyi
2024-03-04 09:57:23 +08:00
parent 53b3e92bd8
commit 8799d6dbdc
20 changed files with 34 additions and 12 deletions
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->create();
timeout=0
cid=1
- 获取添加的type属性type @Jenkins
@@ -44,4 +46,4 @@ r($result1) && p('type') && e('Jenkins');
r($result2) && p('account') && e('JenkinsAccount'); // 获取添加的account
r($result3) && p('url:0') && e('『服务器地址』应当为合法的URL。'); // 添加错误的url信息
r($result4) && p('name:0') && e('『应用名称』不能为空。'); // 添加名称为空时
r($result5) && p('name:0') && e('『应用名称』已经有『Jenkins』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 添加名称重复时
r($result5) && p('name:0') && e('『应用名称』已经有『Jenkins』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 添加名称重复时
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->deleteByObject();
timeout=0
cid=1
- 测试删除id为0的流水线 @0
@@ -30,4 +32,4 @@ $pipelineTester = new pipelineTest();
r($pipelineTester->deleteByObjectTest($idList[0], $types[0])) && p() && e('0'); // 测试删除id为0的流水线
r($pipelineTester->deleteByObjectTest($idList[1], $types[0])) && p('deleted') && e('0'); // 测试删除id为1的流水线
r($pipelineTester->deleteByObjectTest($idList[2], $types[1])) && p('deleted') && e('0'); // 测试删除id为2的流水线
r($pipelineTester->deleteByObjectTest($idList[3], $types[2])) && p('deleted') && e('1'); // 测试删除id为5的流水线
r($pipelineTester->deleteByObjectTest($idList[3], $types[2])) && p('deleted') && e('1'); // 测试删除id为5的流水线
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getByID();
timeout=0
cid=1
- 获取id为0的流水线信息 @0
@@ -27,4 +29,4 @@ $idList = array(0, 1, 2);
$pipelineTester = new pipelineTest();
r($pipelineTester->getByIDTest($idList[0])) && p() && e('0'); // 获取id为0的流水线信息
r($pipelineTester->getByIDTest($idList[1])) && p('type,name,url,account,private') && e('gitlab,gitLab,https://gitlabdev.qc.oop.cc/,root,08bcc98f75d7d40053dc80722bdc117b'); // 获取id为1流水线信息
r($pipelineTester->getByIDTest($idList[2])) && p() && e('0'); // 获取id不存在的流水线信息
r($pipelineTester->getByIDTest($idList[2])) && p() && e('0'); // 获取id不存在的流水线信息
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getByNameAndType();
timeout=0
cid=1
- 获取名称为空类型为空的流水线ID @0
@@ -35,4 +37,4 @@ r($pipelineTester->getByNameAndTypeTest($names[1], $types[1])) && p('id') && e('
r($pipelineTester->getByNameAndTypeTest($names[1], $types[2])) && p() && e('0'); // 获取名称为gitLab类型为test的流水线ID
r($pipelineTester->getByNameAndTypeTest($names[2], $types[0])) && p() && e('0'); // 获取名称为test类型为空的流水线ID
r($pipelineTester->getByNameAndTypeTest($names[2], $types[1])) && p() && e('0'); // 获取名称为test类型为gitlab的流水线ID
r($pipelineTester->getByNameAndTypeTest($names[2], $types[2])) && p() && e('0'); // 获取名称为test类型为test的流水线ID
r($pipelineTester->getByNameAndTypeTest($names[2], $types[2])) && p() && e('0'); // 获取名称为test类型为test的流水线ID
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getByUrl();
timeout=0
cid=1
- 获取url为空的流水线ID @0
@@ -22,4 +24,4 @@ $urlList = array('', 'https://gitlabdev.qc.oop.cc/', 'https://test.qc.oop.cc/');
$pipelineTester = new pipelineTest();
r($pipelineTester->getByUrlTest($urlList[0])) && p() && e('0'); // 获取url为空的流水线ID
r($pipelineTester->getByUrlTest($urlList[1])) && p('id') && e('1'); // 获取url为https://gitlabdev.qc.oop.cc/的流水线ID
r($pipelineTester->getByUrlTest($urlList[2])) && p() && e('0'); // 获取url为https://test.qc.oop.cc/的流水线ID
r($pipelineTester->getByUrlTest($urlList[2])) && p() && e('0'); // 获取url为https://test.qc.oop.cc/的流水线ID
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getList();
timeout=0
cid=1
- 获取类型为空按照id倒序排序,每页5条,第1页的流水线列表
@@ -131,4 +133,4 @@ r($pipelineTester->getListTest($types[2], $sorts[0], $recPerPages[0], $pageIdLis
r($pipelineTester->getListTest($types[2], $sorts[0], $recPerPages[2], $pageIdList[0])) && p() && e('0'); // 获取类型为test按照id倒序排序,每页20条,第1页的流水线列表
r($pipelineTester->getListTest($types[2], $sorts[0], $recPerPages[2], $pageIdList[1])) && p() && e('0'); // 获取类型为test按照id倒序排序,每页20条,第2页的流水线列表
r($pipelineTester->getListTest($types[2], $sorts[1], $recPerPages[1], $pageIdList[0])) && p() && e('0'); // 获取类型为test按照name正序排序,每页10条,第1页的流水线列表
r($pipelineTester->getListTest($types[2], $sorts[1], $recPerPages[1], $pageIdList[1])) && p() && e('0'); // 获取类型为test按照name正序排序,每页10条,第2页的流水线列表
r($pipelineTester->getListTest($types[2], $sorts[1], $recPerPages[1], $pageIdList[1])) && p() && e('0'); // 获取类型为test按照name正序排序,每页10条,第2页的流水线列表
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getOpenIdByAccount();
timeout=0
cid=1
- 获取providerID为0、providerType为空、account为空的openID @0
@@ -71,4 +73,4 @@ r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[1], $a
r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[1], $accounts[2])) && p() && e('0'); // 获取providerID为2、providerType为gitlab、account为test的openID
r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[2], $accounts[0])) && p() && e('0'); // 获取providerID为2、providerType为test、account为空的openID
r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[2], $accounts[1])) && p() && e('0'); // 获取providerID为2、providerType为test、account为admin的openID
r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[2], $accounts[2])) && p() && e('0'); // 获取providerID为2、providerType为test、account为test的openID
r($pipelineTester->getOpenIdByAccountTest($providerIds[2], $providerTypes[2], $accounts[2])) && p() && e('0'); // 获取providerID为2、providerType为test、account为test的openID
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getPairs();
timeout=0
cid=1
- 获取type为空的流水线信息属性1 @gitLab
@@ -28,4 +30,4 @@ r($pipelineTester->getPairsTest($types[2])) && p(0) && e('0'); // 获取t
r(count($pipelineTester->getPairsTest($types[0]))) && p(0) && e('20'); // 获取type为空的流水线信息
r(count($pipelineTester->getPairsTest($types[1]))) && p(0) && e('4'); // 获取type为gitlab的流水线信息
r(count($pipelineTester->getPairsTest($types[2]))) && p(0) && e('0'); // 获取type为test的流水线信息
r(count($pipelineTester->getPairsTest($types[2]))) && p(0) && e('0'); // 获取type为test的流水线信息
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getProviderPairsByAccount();
timeout=0
cid=1
- 获取providerType为空、account为空的providerID @0
@@ -34,4 +36,4 @@ r($pipelineTester->getProviderPairsByAccountTest($providerTypes[1], $accounts[1]
r($pipelineTester->getProviderPairsByAccountTest($providerTypes[1], $accounts[2])) && p() && e('0'); // 获取providerType为gitlab、account为test的providerID
r($pipelineTester->getProviderPairsByAccountTest($providerTypes[2], $accounts[0])) && p() && e('0'); // 获取providerType为test、account为空的providerID
r($pipelineTester->getProviderPairsByAccountTest($providerTypes[2], $accounts[1])) && p() && e('0'); // 获取providerType为test、account为user1的providerID
r($pipelineTester->getProviderPairsByAccountTest($providerTypes[2], $accounts[2])) && p() && e('0'); // 获取providerType为test、account为test的providerID
r($pipelineTester->getProviderPairsByAccountTest($providerTypes[2], $accounts[2])) && p() && e('0'); // 获取providerType为test、account为test的providerID
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->getUserBindedPairs();
timeout=0
cid=1
- 获取Id为0、type为空的用户绑定信息 @0
@@ -37,4 +39,4 @@ r($pipelineTester->getUserBindedPairsTest($providerIds[1], $providerTypes[1], $f
r($pipelineTester->getUserBindedPairsTest($providerIds[1], $providerTypes[2], $fieldList[0])) && p() && e('0'); // 获取Id为1、type为test的用户绑定信息
r($pipelineTester->getUserBindedPairsTest($providerIds[2], $providerTypes[0], $fieldList[0])) && p() && e('0'); // 获取Id为2、type为空的用户绑定信息
r($pipelineTester->getUserBindedPairsTest($providerIds[2], $providerTypes[1], $fieldList[0])) && p() && e('0'); // 获取Id为2、type为gitlab的用户绑定信息
r($pipelineTester->getUserBindedPairsTest($providerIds[2], $providerTypes[2], $fieldList[0])) && p() && e('0'); // 获取Id为2、type为test的用户绑定信息
r($pipelineTester->getUserBindedPairsTest($providerIds[2], $providerTypes[2], $fieldList[0])) && p() && e('0'); // 获取Id为2、type为test的用户绑定信息
+3 -1
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env php
<?php
/**
title=测试 pipelineModel->update();
timeout=0
cid=1
- 测试id为0时,修改名称 @0
@@ -62,4 +64,4 @@ r($pipelineTest->updateTest($idList[1], $emptyName)) && p('name:0')
r($pipelineTest->updateTest($idList[1], $repeatName)) && p('name:0') && e('『应用名称』已经有『gitLab』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 测试id为1时,修改名称重复
r($pipelineTest->updateTest($idList[2], $emptyAccount)) && p('account:0') && e('『用户名』不能为空。'); // 测试id为1时,修改账号为空
r($pipelineTest->updateTest($idList[2], $emptyToken)) && p('token:0') && e('『Token』不能为空。'); // 测试id为1时,修改token为空
r($pipelineTest->updateTest($idList[2], $emptyPassword)) && p('password:0') && e('『密码』不能为空。'); // 测试id为1时,修改password为空
r($pipelineTest->updateTest($idList[2], $emptyPassword)) && p('password:0') && e('『密码』不能为空。'); // 测试id为1时,修改password为空
+1 -1
View File
@@ -70,7 +70,7 @@ class pipelineTest
*/
public function createTest(string $type, object $object)
{
$object->type = $type;
$object->appType = $type;
$pipelineID = $this->objectModel->create($object);