From e0d8afe5de18febbba89477472283bf1899e0aee Mon Sep 17 00:00:00 2001 From: wangyuting Date: Thu, 24 Aug 2023 14:29:49 +0800 Subject: [PATCH] * Optimize browseUnits function on testtask. --- module/testreport/control.php | 2 +- module/testtask/control.php | 43 ++- module/testtask/model.php | 85 +++--- module/testtask/tao.php | 58 ++++ .../testtask/test/model/getproducttasks.php | 138 ++++++---- .../test/model/getproductunittasks.php | 87 +++++- .../model/yaml/getproducttasks/execution.yaml | 75 ++++++ .../model/yaml/getproducttasks/product.yaml | 6 + .../model/yaml/getproducttasks/project.yaml | 6 + .../yaml/getproductunittasks/execution.yaml | 75 ++++++ .../yaml/getproductunittasks/product.yaml | 6 + .../yaml/getproductunittasks/project.yaml | 6 + .../yaml/getproductunittasks/testtask.yaml | 27 ++ .../testtask/test/tao/fetchtesttasklist.php | 247 ++++++++++++++++++ .../tao/yaml/fetchtesttasklist/execution.yaml | 75 ++++++ .../tao/yaml/fetchtesttasklist/product.yaml | 6 + .../tao/yaml/fetchtesttasklist/project.yaml | 6 + module/testtask/ui/browseunits.html.php | 2 +- 18 files changed, 813 insertions(+), 137 deletions(-) create mode 100644 module/testtask/test/model/yaml/getproducttasks/execution.yaml create mode 100644 module/testtask/test/model/yaml/getproducttasks/product.yaml create mode 100644 module/testtask/test/model/yaml/getproducttasks/project.yaml create mode 100644 module/testtask/test/model/yaml/getproductunittasks/execution.yaml create mode 100644 module/testtask/test/model/yaml/getproductunittasks/product.yaml create mode 100644 module/testtask/test/model/yaml/getproductunittasks/project.yaml create mode 100644 module/testtask/test/model/yaml/getproductunittasks/testtask.yaml create mode 100755 module/testtask/test/tao/fetchtesttasklist.php create mode 100644 module/testtask/test/tao/yaml/fetchtesttasklist/execution.yaml create mode 100644 module/testtask/test/tao/yaml/fetchtesttasklist/product.yaml create mode 100644 module/testtask/test/tao/yaml/fetchtesttasklist/project.yaml diff --git a/module/testreport/control.php b/module/testreport/control.php index 6baec7b624..5365ed0537 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -188,7 +188,7 @@ class testreport extends control $taskPairs = array(); $scopeAndStatus[0] = 'local'; $scopeAndStatus[1] = 'totalStatus'; - $tasks = $this->testtask->getProductTasks($productID, empty($objectID) ? 'all' : $task->branch, 'id_desc', null, $scopeAndStatus); + $tasks = $this->testtask->getProductTasks($productID, empty($objectID) ? 'all' : $task->branch, $scopeAndStatus, '', '', 'id_desc', null); foreach($tasks as $testTask) { if($testTask->build == 'trunk') continue; diff --git a/module/testtask/control.php b/module/testtask/control.php index a0ec595cb4..ccd7090883 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -68,6 +68,7 @@ class testtask extends control } /** + * 测试单的列表。 * Browse test tasks. * * @param int $productID @@ -109,7 +110,7 @@ class testtask extends control $endTime = $endTime ? date('Y-m-d', strtotime($endTime)) : ''; $product = $this->product->getById($productID); if($product->type == 'normal') $branch = 'all'; - $tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $type, $beginTime, $endTime); + $tasks = $this->testtask->getProductTasks($productID, $branch, $type, $beginTime, $endTime, $sort, $pager); /* 获取不同状态测试单的数量,用于列表底部统计信息展示。 */ $waitCount = 0; @@ -144,10 +145,13 @@ class testtask extends control } /** + * + * 单元测试列表页面。 * Browse unit tasks. * * @param int $productID * @param string $browseType + * @param int $projectID * @param string $orderBy * @param int $recTotal * @param int $recPerPage @@ -155,17 +159,16 @@ class testtask extends control * @access public * @return void */ - public function browseUnits($productID = 0, $browseType = 'newest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0) + public function browseUnits(int $productID = 0, string $browseType = 'newest', int $projectID = 0, string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1) { /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true), 'qa'); - $this->session->set('caseList', $this->app->getURI(true), $this->app->tab); - $this->session->set('buildList', $this->app->getURI(true) . '#app=' . $this->app->tab, 'execution'); - $this->loadModel('testcase'); - $this->app->loadLang('tree'); + $this->session->set('caseList', $this->app->getURI(true), $this->app->tab); + $this->session->set('buildList', $this->app->getURI(true) . '#app=' . $this->app->tab, 'execution'); /* Set menu. */ - $productID = $this->loadModel('product')->saveState($productID, $this->products); + $products = $this->testtaskZen->getProducts(); + $productID = $this->loadModel('product')->saveState($productID, $products); $product = $this->product->getByID($productID); if($this->app->tab == 'project') { @@ -179,11 +182,11 @@ class testtask extends control } $this->loadModel('project')->setMenu($projectID); - if(!$product->shadow) $this->lang->modulePageNav = $this->product->select($this->products, $productID, 'testtask', 'browseUnits', "projectID=$projectID", '', false); + if(!$product->shadow) $this->lang->modulePageNav = $this->product->select($products, $productID, 'testtask', 'browseUnits', "projectID=$projectID", '', false); } else { - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($products, $productID); $this->app->rawModule = 'testcase'; } @@ -195,20 +198,16 @@ class testtask extends control /* Append id for second sort. */ $sort = common::appendOrder($orderBy); + $this->app->loadLang('testcase'); $this->lang->testcase->featureBar['browseunits'] = $this->lang->testtask->unitTag; - $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common; - $this->view->projectID = $projectID; - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->orderBy = $orderBy; - $this->view->browseType = $browseType; - $this->view->tasks = $this->testtask->getProductUnitTasks($productID, $browseType, $sort, $pager); - $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->pager = $pager; - $this->view->product = $product; - $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); - + $this->view->title = $products[$productID] . $this->lang->colon . $this->lang->testtask->common; + $this->view->productID = $productID; + $this->view->orderBy = $orderBy; + $this->view->browseType = $browseType; + $this->view->tasks = $this->testtask->getProductUnitTasks($productID, $browseType, $sort, $pager); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $this->view->pager = $pager; $this->display(); } @@ -1611,7 +1610,7 @@ class testtask extends control public function ajaxGetDropMenu($productID, $branch, $taskID, $module, $method, $objectType = '', $objectID = 0) { $scope = empty($objectType) ? 'local' : 'all'; - $testtasks = $this->testtask->getProductTasks($productID, $branch, 'id_desc', null, "$scope,totalStatus"); + $testtasks = $this->testtask->getProductTasks($productID, $branch, "$scope,totalStatus", '', '', 'id_desc', null); $namePairs = array(); foreach($testtasks as $testtaskID => $testtask) $namePairs[$testtaskID] = $testtask->name; diff --git a/module/testtask/model.php b/module/testtask/model.php index ea827e2505..224d521af5 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -62,49 +62,22 @@ class testtaskModel extends model * * @param int $productID * @param string $branch + * @param string $type + * @param string $begin + * @param string $end * @param string $orderBy * @param object $pager - * @param string $type - * @param string $beginTime - * @param string $endTime * @access public * @return array */ - public function getProductTasks(int $productID, string $branch = 'all', string $orderBy = 'id_desc', object $pager = null, string $type = '', string $beginTime = '', string $endTime = ''): array + public function getProductTasks(int $productID, string $branch = 'all', string $type = '', string $begin = '', string $end = '', string $orderBy = 'id_desc', object $pager = null): array { $scopeAndStatus = explode(',', $type); $scope = !empty($scopeAndStatus[0]) ? $scopeAndStatus[0] : ''; $status = !empty($scopeAndStatus[1]) ? $scopeAndStatus[1] : ''; $branch = $scope == 'all' ? 'all' : $branch; - $tasks = $this->dao->select("t1.*, t5.multiple, IF(t2.shadow = 1, t5.name, t2.name) AS productName, t3.name as executionName, t4.name AS buildName, t4.branch AS branch, t5.name AS projectName") - ->from(TABLE_TESTTASK)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') - ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id') - ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id') - ->leftJoin(TABLE_PROJECT)->alias('t5')->on('t3.project = t5.id') - ->where('t1.deleted')->eq(0) - ->andWhere('t1.auto')->ne('unit') - ->beginIF(!$this->app->user->admin)->andWhere('t3.id')->in("0,{$this->app->user->view->sprints}")->fi() - ->beginIF($scope == 'local')->andWhere('t1.product')->eq((int)$productID)->fi() - ->beginIF($scope == 'all')->andWhere('t1.product')->in($this->app->user->view->products)->fi() - ->beginIF(strtolower($status) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi() - ->beginIF(strtolower($status) == 'review') // 工作流开启审批的时候才会使用,才会新增字段。 - ->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)") - ->andWhere('t1.reviewStatus')->eq('doing') - ->fi() - ->beginIF(!in_array(strtolower($status), array('totalstatus', 'review'), true))->andWhere('t1.status')->eq($status)->fi() - ->beginIF($branch !== 'all')->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi() - ->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi() - ->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi() - ->beginIF($branch == BRANCH_MAIN) - ->orWhere('(t1.build')->eq('trunk') - ->andWhere('t1.product')->eq($productID) - ->markRight(1) - ->fi() - ->orderBy($orderBy) - ->page($pager) - ->fetchAll('id'); + $tasks = $this->fetchTesttaskList($productID, $branch, 0, '', $scope, $status, $begin, $end, $orderBy, $pager); foreach($tasks as $taskID => $task) { @@ -125,43 +98,37 @@ class testtaskModel extends model } /** + * 获取产品对应的单元测试类型的测试单。 * Get product unit tasks. * * @param int $productID * @param string $browseType * @param string $orderBy - * @param int $pager + * @param object $pager * @access public - * @return void + * @return array */ - public function getProductUnitTasks($productID, $browseType = '', $orderBy = 'id_desc', $pager = null) + public function getProductUnitTasks(int $productID, string $browseType = 'newest', string $orderBy = 'id_desc', object $pager = null): array { + $begin = ''; + $end = ''; $beginAndEnd = $this->loadModel('action')->computeBeginAndEnd($browseType); - if(empty($beginAndEnd)) $beginAndEnd = array('begin' => '', 'end' => ''); - + if($browseType != 'all' and $browseType != 'newest' and !empty($beginAndEnd)) + { + $begin = $beginAndEnd['begin']; + $end = $beginAndEnd['end']; + } if($browseType == 'newest') $orderBy = 'end_desc,' . $orderBy; - $tasks = $this->dao->select("t1.*, t2.name AS productName, t3.name AS executionName, t4.name AS buildName") - ->from(TABLE_TESTTASK)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') - ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id') - ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id') - ->where('t1.deleted')->eq(0) - ->andWhere('t1.product')->eq($productID) - ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi() - ->andWhere('t1.auto')->eq('unit') - ->beginIF($browseType != 'all' and $browseType != 'newest' and $beginAndEnd) - ->andWhere('t1.end')->ge($beginAndEnd['begin']) - ->andWhere('t1.end')->le($beginAndEnd['end']) - ->fi() - ->orderBy($orderBy) - ->page($pager) - ->fetchAll('id'); + + $projectID = $this->lang->navGroup->testtask != 'qa' ? $this->session->project : 0; + $tasks = $this->fetchTesttaskList($productID, '', 0, 'unit', 'local', '', $begin, $end, $orderBy, $pager); $resultGroups = $this->dao->select('t1.task, t2.*')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_TESTRESULT)->alias('t2')->on('t1.id=t2.run') ->where('t1.task')->in(array_keys($tasks)) ->fetchGroup('task', 'run'); + /* 计算本测试单执行的用例数、成功数、失败数。 */ foreach($tasks as $taskID => $task) { $results = zget($resultGroups, $taskID, array()); @@ -174,6 +141,18 @@ class testtaskModel extends model if($result->caseResult == 'pass') $task->passCount ++; if($result->caseResult == 'fail') $task->failCount ++; } + + if($task->multiple) + { + if($task->projectName and $task->executionName) + { + $task->executionName = $task->projectName . '/' . $task->executionName; + } + elseif(!$task->executionName) + { + $task->executionName = $task->projectName; + } + } } return $tasks; diff --git a/module/testtask/tao.php b/module/testtask/tao.php index 5dd1f01970..cafd7b7849 100644 --- a/module/testtask/tao.php +++ b/module/testtask/tao.php @@ -2,4 +2,62 @@ declare(strict_types=1); class testtaskTao extends testtaskModel { + /** + * 查询测试单列表。 + * Fetch testtask list. + * + * @param int $productID + * @param string $branch + * @param int $projectID + * @param string $unit + * @param string $scope + * @param string $status + * @param string $begin + * @param string $end + * @param string $orderBy + * @param object $pager + * @access protected + * @return array + */ + protected function fetchTesttaskList(int $productID, string $branch = '', int $projectID = 0, string $unit = 'no', string $scope = '', string $status = '', string $begin = '', string $end = '', string $orderBy = '', object $pager = null): array + { + $tasks = $this->dao->select("t1.*, t5.multiple, IF(t2.shadow = 1, t5.name, t2.name) AS productName, t3.name as executionName, t4.name AS buildName, t4.branch AS branch, t5.name AS projectName") + ->from(TABLE_TESTTASK)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') + ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id') + ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id') + ->leftJoin(TABLE_PROJECT)->alias('t5')->on('t3.project = t5.id') + ->where('t1.deleted')->eq(0) + ->beginIF($unit == 'unit')->andWhere('t1.auto')->eq('unit')->fi() + ->beginIF($unit != 'unit')->andWhere('t1.auto')->ne('unit')->fi() + ->beginIF(!$this->app->user->admin)->andWhere('t3.id')->in("0,{$this->app->user->view->sprints}")->fi() + ->beginIF($scope == 'local')->andWhere('t1.product')->eq($productID)->fi() + ->beginIF($scope == 'all')->andWhere('t1.product')->in($this->app->user->view->products)->fi() + ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() + ->beginIF(strtolower($status) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi() + ->beginIF(strtolower($status) == 'review') // 工作流开启审批的时候才会使用,才会新增字段。 + ->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)") + ->andWhere('t1.reviewStatus')->eq('doing') + ->fi() + ->beginIF(!in_array(strtolower($status), array('totalstatus', 'review'), true) && $status)->andWhere('t1.status')->eq($status)->fi() + ->beginIF($unit != 'unit') + ->beginIF($begin)->andWhere('t1.begin')->ge($begin)->fi() + ->beginIF($end)->andWhere('t1.end')->le($end)->fi() + ->fi() + ->beginIF($unit == 'unit') + ->beginIF($begin)->andWhere('t1.end')->ge($begin)->fi() + ->beginIF($end)->andWhere('t1.end')->le($end)->fi() + ->fi() + ->beginIF($branch !== 'all' && $branch)->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi() + ->beginIF($branch == BRANCH_MAIN) + ->orWhere('(t1.build')->eq('trunk') + ->andWhere('t1.product')->eq($productID) + ->markRight(1) + ->fi() + ->orderBy($orderBy) + ->page($pager) + ->fetchAll('id'); + + return $tasks; + } } diff --git a/module/testtask/test/model/getproducttasks.php b/module/testtask/test/model/getproducttasks.php index 08714fe7b4..1e03b3095b 100755 --- a/module/testtask/test/model/getproducttasks.php +++ b/module/testtask/test/model/getproducttasks.php @@ -3,8 +3,8 @@ include dirname(__FILE__, 5) . '/test/lib/init.php'; su('admin'); -zdTable('product')->gen(100); -zdTable('project')->gen(100); +zdTable('product')->config('product')->gen(100); +zdTable('project')->config('project')->gen(100); zdTable('project')->config('execution')->gen(300, false); zdTable('build')->gen(500); zdTable('testtask')->gen(500); @@ -33,93 +33,117 @@ cid=1 - 查询有权限产品的阻塞状态的测试单的数量 @30 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在今天之后的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在昨天之后的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在明天之后的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且结束时间在今天之内的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且结束时间在6天后之内的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在今天之内的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在6天后之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在7天后之内的的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在8天后之内的的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在今天之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在6天后之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在7天后之内的的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @5 +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在8天后之内的的测试单的数量 @5 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在今天之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在6天后之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在7天后之内的的测试单的数量 @0 -- 查询产品ID为1的所有状态且某时间段的测试单的数量 @0 +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在8天后之内的的测试单的数量 @0 -- 查询产品ID为1的测试单对应的产品名称第1条的productName属性 @正常产品1 +- 查询产品ID为1、测试单ID为1的测试单对应的产品名称第1条的productName属性 @正常产品1 -- 查询产品ID为2的测试单对应的产品名称第2条的productName属性 @项目12 +- 查询产品ID为2、测试单ID为2的测试单对应的产品名称第2条的productName属性 @项目12 -- 查询产品ID为1的测试单对应的产品名称第1条的executionName属性 @迭代1 +- 查询产品ID为1、测试单ID为1的测试单对应的执行名称第1条的executionName属性 @迭代1 -- 查询产品ID为1的测试单对应的产品名称第2条的executionName属性 @项目12/迭代2 +- 查询产品ID为1、测试单ID为2的测试单对应的执行名称第2条的executionName属性 @项目12/迭代2 + +- 验证产品ID为1,索引为201数据的所有字段 + - 第201条的id属性 @201 + - 第201条的project属性 @11 + - 第201条的name属性 @测试单1 + - 第201条的product属性 @1 + - 第201条的execution属性 @101 + - 第201条的build属性 @11 + - 第201条的owner属性 @user11 + - 第201条的pri属性 @1 + - 第201条的desc属性 @这是测试单描述201 + - 第201条的status属性 @wait + - 第201条的testreport属性 @0 + - 第201条的auto属性 @no + - 第201条的deleted属性 @0 */ global $tester; $tester->loadModel('testtask'); -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus'))) && p() && e('5'); // 查询产品ID为1的所有状态的测试单的数量 -r(count($tester->testtask->getProductTasks(51, 'all', 'id_desc', null, 'local,totalstatus'))) && p() && e('0'); // 查询产品ID为51的所有状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,wait'))) && p() && e('5'); // 查询产品ID为1的等待状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,done'))) && p() && e('0'); // 查询产品ID为1的完成状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,blocked'))) && p() && e('0'); // 查询产品ID为1的阻塞状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'all,totalstatus'))) && p() && e('150'); // 查询有权限产品的所有状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'all,wait'))) && p() && e('45'); // 查询有权限产品的等待状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'all,done'))) && p() && e('30'); // 查询有权限产品的完成状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'all,blocked'))) && p() && e('30'); // 查询有权限产品的阻塞状态的测试单的数量 +$localTotal = 'local,totalstatus'; +$yesterday = date('Y-m-d', strtotime('-1 day')); +$today = date('Y-m-d'); +$oneDayLater = date('Y-m-d', strtotime('+1 day')); +$sixDaysLater = date('Y-m-d', strtotime('+6 day')); +$sevenDaysLater = date('Y-m-d', strtotime('+7 day')); +$eightDaysLater = date('Y-m-d', strtotime('+8 day')); -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d')))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('-1 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('+1 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus'))) && p() && e('5'); // 查询产品ID为1的所有状态的测试单的数量 +r(count($tester->testtask->getProductTasks(51, 'all', 'local,totalstatus'))) && p() && e('0'); // 查询产品ID为51的所有状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,wait'))) && p() && e('5'); // 查询产品ID为1的等待状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,done'))) && p() && e('0'); // 查询产品ID为1的完成状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,blocked'))) && p() && e('0'); // 查询产品ID为1的阻塞状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'all,totalstatus'))) && p() && e('150'); // 查询有权限产品的所有状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'all,wait'))) && p() && e('45'); // 查询有权限产品的等待状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'all,done'))) && p() && e('30'); // 查询有权限产品的完成状态的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'all,blocked'))) && p() && e('30'); // 查询有权限产品的阻塞状态的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', '', date('Y-m-d')))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', '', date('Y-m-d', strtotime('+6 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', '', date('Y-m-d', strtotime('+7 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', '', date('Y-m-d', strtotime('+8 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $today))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $yesterday))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $oneDayLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d'), date('Y-m-d')))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d'), date('Y-m-d', strtotime('+6 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d'), date('Y-m-d', strtotime('+7 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d'), date('Y-m-d', strtotime('+8 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', '', $today))) && p() && e('0'); // 查询产品ID为1的所有状态且结束时间在今天之内的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', '', $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且结束时间在6天后之内的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', '', $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', '', $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('-1 day')), date('Y-m-d')))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('-1 day')), date('Y-m-d', strtotime('+6 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('-1 day')), date('Y-m-d', strtotime('+7 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('-1 day')), date('Y-m-d', strtotime('+8 day'))))) && p() && e('5'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $today, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在今天之内的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $today, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $today, $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $today, $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在8天后之内的的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('+1 day')), date('Y-m-d')))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('+1 day')), date('Y-m-d', strtotime('+6 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('+1 day')), date('Y-m-d', strtotime('+7 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 -r(count($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus', date('Y-m-d', strtotime('+1 day')), date('Y-m-d', strtotime('+8 day'))))) && p() && e('0'); // 查询产品ID为1的所有状态且某时间段的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $yesterday, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在今天之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $yesterday, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $yesterday, $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $yesterday, $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在8天后之内的的测试单的数量 -r($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus')) && p('1:productName') && e('正常产品1'); // 查询产品ID为1、测试单ID为1的测试单对应的执行名称 -r($tester->testtask->getProductTasks(2, 'all', 'id_desc', null, 'local,totalstatus')) && p('2:productName') && e('项目12'); // 查询产品ID为2、测试单ID为2的测试单对应的执行名称 -r($tester->testtask->getProductTasks(1, 'all', 'id_desc', null, 'local,totalstatus')) && p('1:executionName') && e('迭代1'); // 查询产品ID为1、测试单ID为1的测试单对应的执行名称 -r($tester->testtask->getProductTasks(2, 'all', 'id_desc', null, 'local,totalstatus')) && p('2:executionName') && e('项目12/迭代2'); // 查询产品ID为1、测试单ID为2的测试单对应的执行名称 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $oneDayLater, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在今天之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $oneDayLater, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $oneDayLater, $sevenDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus', $oneDayLater, $eightDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在8天后之内的的测试单的数量 +r($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus')) && p('1:productName') && e('正常产品1'); // 查询产品ID为1、测试单ID为1的测试单对应的产品名称 +r($tester->testtask->getProductTasks(2, 'all', 'local,totalstatus')) && p('2:productName') && e('项目12'); // 查询产品ID为2、测试单ID为2的测试单对应的产品名称 +r($tester->testtask->getProductTasks(1, 'all', 'local,totalstatus')) && p('1:executionName') && e('迭代1'); // 查询产品ID为1、测试单ID为1的测试单对应的执行名称 +r($tester->testtask->getProductTasks(2, 'all', 'local,totalstatus')) && p('2:executionName') && e('项目12/迭代2'); // 查询产品ID为1、测试单ID为2的测试单对应的执行名称 + +r($tester->testtask->getProductTasks(1)) && p('201:id,project,name,product,execution,build,owner,pri,desc,status,testreport,auto,deleted') && e('201,11,测试单1,1,101,11,user11,1,这是测试单描述201,wait,0,no,0'); // 验证产品ID为1,索引为201数据的所有字段 diff --git a/module/testtask/test/model/getproductunittasks.php b/module/testtask/test/model/getproductunittasks.php index 1e9656b819..441ab265d5 100755 --- a/module/testtask/test/model/getproductunittasks.php +++ b/module/testtask/test/model/getproductunittasks.php @@ -3,19 +3,100 @@ include dirname(__FILE__, 5) . '/test/lib/init.php'; su('admin'); +zdTable('product')->config('product')->gen(100); +zdTable('project')->config('project')->gen(100); +zdTable('project')->config('execution')->gen(300, false); +zdTable('build')->gen(500); +zdTable('testrun')->gen(70); +zdTable('testresult')->gen(50); +zdTable('testtask')->config('testtask')->gen(500); + /** title=测试 testtaskModel->getProductUnitTasks(); +timeout=0 cid=1 -pid=1 +- 查询产品ID为1的单元测试单的数量 @25 +- 查询产品ID为1的筛选条件为全部的单元测试单的数量 @25 + +- 查询产品ID为1的筛选条件为最近的单元测试单的数量 @25 + +- 查询产品ID为1的筛选条件为本周的单元测试单的数量 @25 + +- 查询产品ID为1的筛选条件为上周的单元测试单的数量 @0 + +- 查询产品ID为1的筛选条件为本月的单元测试单的数量 @25 + +- 查询产品ID为1的筛选条件为上月的单元测试单的数量 @0 + +- 验证按ID正序排序后的第一条数据是否正确属性name @单元测试41 + +- 验证按ID倒序排序后的第一条数据是否正确属性name @单元测试1 + +- 验证按所属项目正序排序后的第一条数据是否正确属性name @单元测试41 + +- 验证按所属项目倒序排序后的第一条数据是否正确属性name @单元测试1 + +- 查询产品ID为1、测试单ID为51的测试单对应的产品名称第51条的productName属性 @正常产品1 + +- 查询产品ID为2、测试单ID为52的测试单对应的产品名称第52条的productName属性 @项目12 + +- 查询产品ID为1、测试单ID为51的测试单对应的执行名称第51条的executionName属性 @迭代1 + +- 查询产品ID为1、测试单ID为52的测试单对应的执行名称第52条的executionName属性 @项目12/迭代2 + +- 查询产品ID为1、测试单ID为51的测试单对应的执行用例数、通过数、失败数 + - 第51条的caseCount属性 @3 + - 第51条的passCount属性 @2 + - 第51条的failCount属性 @1 + +- 验证产品ID为1,索引为351数据的所有字段 + - 第351条的id属性 @351 + - 第351条的project属性 @11 + - 第351条的name属性 @单元测试1 + - 第351条的product属性 @1 + - 第351条的execution属性 @101 + - 第351条的build属性 @11 + - 第351条的owner属性 @user5 + - 第351条的pri属性 @3 + - 第351条的desc属性 @这是测试单描述351 + - 第351条的status属性 @done + - 第351条的testreport属性 @0 + - 第351条的auto属性 @unit + - 第351条的deleted属性 @0 */ global $tester; $tester->loadModel('testtask'); -$tasks = $tester->testtask->getProductUnitTasks(1, 'all'); +r(count($tester->testtask->getProductUnitTasks(1))) && p() && e('25'); // 查询产品ID为1的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'all'))) && p() && e('25'); // 查询产品ID为1的筛选条件为全部的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'newest'))) && p() && e('25'); // 查询产品ID为1的筛选条件为最近的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'thisWeek'))) && p() && e('25'); // 查询产品ID为1的筛选条件为本周的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'lastWeek'))) && p() && e('0'); // 查询产品ID为1的筛选条件为上周的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'thisMonth'))) && p() && e('25'); // 查询产品ID为1的筛选条件为本月的单元测试单的数量 +r(count($tester->testtask->getProductUnitTasks(1, 'lastMonth'))) && p() && e('0'); // 查询产品ID为1的筛选条件为上月的单元测试单的数量 -r($testtask->getProductUnitTasksTest()) && p() && e(); \ No newline at end of file +$data = $tester->testtask->getProductUnitTasks(1, 'all', 'id_desc'); +r(reset($data)) && p('name') && e('单元测试41'); // 验证按ID正序排序后的第一条数据是否正确 + +$data = $tester->testtask->getProductUnitTasks(1, 'all', 'id_asc'); +r(reset($data)) && p('name') && e('单元测试1'); // 验证按ID倒序排序后的第一条数据是否正确 + +$data = $tester->testtask->getProductUnitTasks(1, 'all', 'project_desc'); +r(reset($data)) && p('name') && e('单元测试41'); // 验证按所属项目正序排序后的第一条数据是否正确 + +$data = $tester->testtask->getProductUnitTasks(1, 'all', 'project_asc'); +r(reset($data)) && p('name') && e('单元测试1'); // 验证按所属项目倒序排序后的第一条数据是否正确 + +r($tester->testtask->getProductUnitTasks(1, 'all')) && p('51:productName') && e('正常产品1'); // 查询产品ID为1、测试单ID为51的测试单对应的产品名称 +r($tester->testtask->getProductUnitTasks(2, 'all')) && p('52:productName') && e('项目12'); // 查询产品ID为2、测试单ID为52的测试单对应的产品名称 +r($tester->testtask->getProductUnitTasks(1, 'all')) && p('51:executionName') && e('迭代1'); // 查询产品ID为1、测试单ID为51的测试单对应的执行名称 +r($tester->testtask->getProductUnitTasks(2, 'all')) && p('52:executionName') && e('项目12/迭代2'); // 查询产品ID为1、测试单ID为52的测试单对应的执行名称 + +r($tester->testtask->getProductUnitTasks(1, 'all')) && p('51:caseCount,passCount,failCount') && e('3,2,1'); // 查询产品ID为1、测试单ID为51的测试单对应的执行用例数、通过数、失败数 + +r($tester->testtask->getProductUnitTasks(1)) && p('351:id,project,name,product,execution,build,owner,pri,desc,status,testreport,auto,deleted') && e('351,11,单元测试1,1,101,11,user5,3,这是测试单描述351,done,0,unit,0'); // 验证产品ID为1,索引为351数据的所有字段 diff --git a/module/testtask/test/model/yaml/getproducttasks/execution.yaml b/module/testtask/test/model/yaml/getproducttasks/execution.yaml new file mode 100644 index 0000000000..c01c1e03cb --- /dev/null +++ b/module/testtask/test/model/yaml/getproducttasks/execution.yaml @@ -0,0 +1,75 @@ +title: table zt_execution +author: Zhu Jinyong +version: "1.0" +fields: + - field: id + range: 101-700 + - field: name + note: "名称" + fields: + - field: name1 + range: 迭代{30},阶段{30},看板{30} + - field: name2 + range: 1-10000 + - field: project + range: 11-100 + - field: model + range: [] + - field: type + range: sprint{30},stage{30},kanban{30} + - field: budget + range: 800000-1:100 + - field: status + range: wait,doing + - field: percent + range: 0{30},10{30},0{30} + - field: milestone + range: 0{30},1{10},0{10},1{10},0{30} + - field: auth + range: "extend" + - field: desc + range: 1-10000 + prefix: "迭代描述" + - field: begin + range: "(-2M)-(+M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: end + range: "(+1w)-(+2M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: grade + range: 1 + - field: parent + range: 11-40,41-70,71-100 + - field: path + fields: + - field: path1 + prefix: "," + range: 11-100 + - field: path2 + prefix: "," + range: 101-700 + postfix: "," + - field: acl + range: open{4},private{4} + - field: openedVersion + range: "16.5" + - field: whitelist + froms: + - from: common.user.v1.yaml + use: empty{8} + - from: common.user.v1.yaml + use: empty{8} + prefix: "," + - from: common.user.v1.yaml + use: one{8} + prefix: "," + - from: common.user.v1.yaml + use: two{8} + prefix: "," + - from: common.user.v1.yaml + use: three{8} + prefix: "," diff --git a/module/testtask/test/model/yaml/getproducttasks/product.yaml b/module/testtask/test/model/yaml/getproducttasks/product.yaml new file mode 100644 index 0000000000..3ddf63ec6b --- /dev/null +++ b/module/testtask/test/model/yaml/getproducttasks/product.yaml @@ -0,0 +1,6 @@ +title: table zt_product +author: Wang Yuting +version: "1.0" +fields: + - field: shadow + range: 0-1 diff --git a/module/testtask/test/model/yaml/getproducttasks/project.yaml b/module/testtask/test/model/yaml/getproducttasks/project.yaml new file mode 100644 index 0000000000..ce0ed88723 --- /dev/null +++ b/module/testtask/test/model/yaml/getproducttasks/project.yaml @@ -0,0 +1,6 @@ +title: table zt_project +author: Wang Yuting +version: "1.0" +fields: + - field: multiple + range: 0-1 diff --git a/module/testtask/test/model/yaml/getproductunittasks/execution.yaml b/module/testtask/test/model/yaml/getproductunittasks/execution.yaml new file mode 100644 index 0000000000..c01c1e03cb --- /dev/null +++ b/module/testtask/test/model/yaml/getproductunittasks/execution.yaml @@ -0,0 +1,75 @@ +title: table zt_execution +author: Zhu Jinyong +version: "1.0" +fields: + - field: id + range: 101-700 + - field: name + note: "名称" + fields: + - field: name1 + range: 迭代{30},阶段{30},看板{30} + - field: name2 + range: 1-10000 + - field: project + range: 11-100 + - field: model + range: [] + - field: type + range: sprint{30},stage{30},kanban{30} + - field: budget + range: 800000-1:100 + - field: status + range: wait,doing + - field: percent + range: 0{30},10{30},0{30} + - field: milestone + range: 0{30},1{10},0{10},1{10},0{30} + - field: auth + range: "extend" + - field: desc + range: 1-10000 + prefix: "迭代描述" + - field: begin + range: "(-2M)-(+M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: end + range: "(+1w)-(+2M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: grade + range: 1 + - field: parent + range: 11-40,41-70,71-100 + - field: path + fields: + - field: path1 + prefix: "," + range: 11-100 + - field: path2 + prefix: "," + range: 101-700 + postfix: "," + - field: acl + range: open{4},private{4} + - field: openedVersion + range: "16.5" + - field: whitelist + froms: + - from: common.user.v1.yaml + use: empty{8} + - from: common.user.v1.yaml + use: empty{8} + prefix: "," + - from: common.user.v1.yaml + use: one{8} + prefix: "," + - from: common.user.v1.yaml + use: two{8} + prefix: "," + - from: common.user.v1.yaml + use: three{8} + prefix: "," diff --git a/module/testtask/test/model/yaml/getproductunittasks/product.yaml b/module/testtask/test/model/yaml/getproductunittasks/product.yaml new file mode 100644 index 0000000000..3ddf63ec6b --- /dev/null +++ b/module/testtask/test/model/yaml/getproductunittasks/product.yaml @@ -0,0 +1,6 @@ +title: table zt_product +author: Wang Yuting +version: "1.0" +fields: + - field: shadow + range: 0-1 diff --git a/module/testtask/test/model/yaml/getproductunittasks/project.yaml b/module/testtask/test/model/yaml/getproductunittasks/project.yaml new file mode 100644 index 0000000000..ce0ed88723 --- /dev/null +++ b/module/testtask/test/model/yaml/getproductunittasks/project.yaml @@ -0,0 +1,6 @@ +title: table zt_project +author: Wang Yuting +version: "1.0" +fields: + - field: multiple + range: 0-1 diff --git a/module/testtask/test/model/yaml/getproductunittasks/testtask.yaml b/module/testtask/test/model/yaml/getproductunittasks/testtask.yaml new file mode 100644 index 0000000000..c4bd14131f --- /dev/null +++ b/module/testtask/test/model/yaml/getproductunittasks/testtask.yaml @@ -0,0 +1,27 @@ +title: table zt_testtask +author: Wang Yuting +version: "1.0" +fields: + - field: product + note: "所属产品" + range: 1-10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: begin + note: "开始日期" + range: "(M)-(w):60" + type: timestamp + prefix: "" + postfix: "" + loop: 0 + format: "YYYY-MM-DD" + - field: end + note: "结束日期" + range: "(M)-(w):60" + type: timestamp + prefix: "" + postfix: "" + loop: 0 + format: "YYYY-MM-DD" diff --git a/module/testtask/test/tao/fetchtesttasklist.php b/module/testtask/test/tao/fetchtesttasklist.php new file mode 100755 index 0000000000..f6bafbc984 --- /dev/null +++ b/module/testtask/test/tao/fetchtesttasklist.php @@ -0,0 +1,247 @@ +#!/usr/bin/env php +config('product')->gen(100); +zdTable('project')->config('project')->gen(100); +zdTable('project')->config('execution')->gen(300, false); +zdTable('build')->gen(500); +zdTable('testtask')->gen(500); + +/** + +title=测试 testtaskModel->fetchTesttaskList(); +timeout=0 +cid=1 + +- 查询产品ID为1的所有状态的测试单的数量 @5 + +- 查询产品ID为51的所有状态的测试单的数量 @0 + +- 查询产品ID为1的等待状态的测试单的数量 @5 + +- 查询产品ID为1的完成状态的测试单的数量 @0 + +- 查询产品ID为1的阻塞状态的测试单的数量 @0 + +- 查询有权限产品的所有状态的测试单的数量 @150 + +- 查询有权限产品的等待状态的测试单的数量 @45 + +- 查询有权限产品的完成状态的测试单的数量 @30 + +- 查询有权限产品的阻塞状态的测试单的数量 @30 + +- 查询产品ID为1、项目ID为11的所有状态的测试单的数量 @5 + +- 查询产品ID为1、项目ID为11的等待状态的测试单的数量 @5 + +- 查询产品ID为1、项目ID为11的完成状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为11的阻塞状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的所有状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的等待状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的完成状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的阻塞状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为11的所有状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为11的等待状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为11的完成状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为11的阻塞状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的所有状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为12的等待状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的完成状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的阻塞状态的测试单的数量 @0 + +- 查询产品ID为1的所有状态的单元测试单的数量 @5 + +- 查询产品ID为51的所有状态的单元测试单的数量 @0 + +- 查询产品ID为1的等待状态的单元测试单的数量 @0 + +- 查询产品ID为1的完成状态的单元测试单的数量 @5 + +- 查询产品ID为1的阻塞状态的单元测试单的数量 @0 + +- 查询有权限产品的所有状态的单元测试单的数量 @150 + +- 查询有权限产品的等待状态的单元测试单的数量 @30 + +- 查询有权限产品的完成状态的单元测试单的数量 @45 + +- 查询有权限产品的阻塞状态的单元测试单的数量 @45 + +- 查询产品ID为1、项目ID为11的所有状态的测试单的数量 @5 + +- 查询产品ID为1、项目ID为11的等待状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为11的完成状态的测试单的数量 @5 + +- 查询产品ID为1、项目ID为11的阻塞状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的所有状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的等待状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的完成状态的测试单的数量 @0 + +- 查询产品ID为1、项目ID为12的阻塞状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为11的所有状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为11的等待状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为11的完成状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为11的阻塞状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的所有状态的测试单的数量 @5 + +- 查询有权限产品、项目ID为12的等待状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的完成状态的测试单的数量 @0 + +- 查询有权限产品、项目ID为12的阻塞状态的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在今天之后的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在昨天之后的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在明天之后的测试单的数量 @0 + +- 查询产品ID为1的所有状态且结束时间在今天之内的测试单的数量 @0 + +- 查询产品ID为1的所有状态且结束时间在6天后之内的测试单的数量 @0 + +- 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 @5 + +- 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在今天之内的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在6天后之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在7天后之内的的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在今天之后结束时间在8天后之内的的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在今天之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在6天后之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在7天后之内的的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在8天后之内的的测试单的数量 @5 + +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在今天之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在6天后之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在7天后之内的的测试单的数量 @0 + +- 查询产品ID为1的所有状态且开始时间在明天之后结束时间在8天后之内的的测试单的数量 @0 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$localTotal = 'local,totalstatus'; +$yesterday = date('Y-m-d', strtotime('-1 day')); +$today = date('Y-m-d'); +$oneDayLater = date('Y-m-d', strtotime('+1 day')); +$sixDaysLater = date('Y-m-d', strtotime('+6 day')); +$sevenDaysLater = date('Y-m-d', strtotime('+7 day')); +$eightDaysLater = date('Y-m-d', strtotime('+8 day')); + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus'))) && p() && e('5'); // 查询产品ID为1的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(51, 'all', 0, 'no', 'local', 'totalstatus'))) && p() && e('0'); // 查询产品ID为51的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'wait'))) && p() && e('5'); // 查询产品ID为1的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'done'))) && p() && e('0'); // 查询产品ID为1的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'all', 'totalstatus'))) && p() && e('150'); // 查询有权限产品的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'all', 'wait'))) && p() && e('45'); // 查询有权限产品的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'all', 'done'))) && p() && e('30'); // 查询有权限产品的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'all', 'blocked'))) && p() && e('30'); // 查询有权限产品的阻塞状态的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'local', 'totalstatus'))) && p() && e('5'); // 查询产品ID为1、项目ID为11的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'local', 'wait'))) && p() && e('5'); // 查询产品ID为1、项目ID为11的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'local', 'done'))) && p() && e('0'); // 查询产品ID为1、项目ID为11的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1、项目ID为11的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'local', 'totalstatus'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'local', 'wait'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'local', 'done'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'all', 'totalstatus'))) && p() && e('5'); // 查询有权限产品、项目ID为11的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'all', 'wait'))) && p() && e('5'); // 查询有权限产品、项目ID为11的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'all', 'done'))) && p() && e('0'); // 查询有权限产品、项目ID为11的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'no', 'all', 'blocked'))) && p() && e('0'); // 查询有权限产品、项目ID为11的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'all', 'totalstatus'))) && p() && e('5'); // 查询有权限产品、项目ID为12的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'all', 'wait'))) && p() && e('0'); // 查询有权限产品、项目ID为12的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'all', 'done'))) && p() && e('0'); // 查询有权限产品、项目ID为12的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'no', 'all', 'blocked'))) && p() && e('0'); // 查询有权限产品、项目ID为12的阻塞状态的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'local', 'totalstatus'))) && p() && e('5'); // 查询产品ID为1的所有状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(51, 'all', 0, 'unit', 'local', 'totalstatus'))) && p() && e('0'); // 查询产品ID为51的所有状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'local', 'wait'))) && p() && e('0'); // 查询产品ID为1的等待状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'local', 'done'))) && p() && e('5'); // 查询产品ID为1的完成状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1的阻塞状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'all', 'totalstatus'))) && p() && e('150'); // 查询有权限产品的所有状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'all', 'wait'))) && p() && e('30'); // 查询有权限产品的等待状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'all', 'done'))) && p() && e('45'); // 查询有权限产品的完成状态的单元测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'unit', 'all', 'blocked'))) && p() && e('45'); // 查询有权限产品的阻塞状态的单元测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'local', 'totalstatus'))) && p() && e('5'); // 查询产品ID为1、项目ID为11的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'local', 'wait'))) && p() && e('0'); // 查询产品ID为1、项目ID为11的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'local', 'done'))) && p() && e('5'); // 查询产品ID为1、项目ID为11的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1、项目ID为11的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'local', 'totalstatus'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'local', 'wait'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'local', 'done'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'local', 'blocked'))) && p() && e('0'); // 查询产品ID为1、项目ID为12的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'all', 'totalstatus'))) && p() && e('5'); // 查询有权限产品、项目ID为11的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'all', 'wait'))) && p() && e('0'); // 查询有权限产品、项目ID为11的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'all', 'done'))) && p() && e('5'); // 查询有权限产品、项目ID为11的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 11, 'unit', 'all', 'blocked'))) && p() && e('0'); // 查询有权限产品、项目ID为11的阻塞状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'all', 'totalstatus'))) && p() && e('5'); // 查询有权限产品、项目ID为12的所有状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'all', 'wait'))) && p() && e('0'); // 查询有权限产品、项目ID为12的等待状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'all', 'done'))) && p() && e('0'); // 查询有权限产品、项目ID为12的完成状态的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 12, 'unit', 'all', 'blocked'))) && p() && e('5'); // 查询有权限产品、项目ID为12的阻塞状态的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $today))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $yesterday))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $oneDayLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', '', $today))) && p() && e('0'); // 查询产品ID为1的所有状态且结束时间在今天之内的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', '', $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且结束时间在6天后之内的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', '', $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', '', $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且结束时间在7天后之内的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $today, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在今天之内的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $today, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $today, $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $today, $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在今天之后结束时间在8天后之内的的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $yesterday, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在今天之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $yesterday, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $yesterday, $sevenDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $yesterday, $eightDaysLater))) && p() && e('5'); // 查询产品ID为1的所有状态且开始时间在昨天之后结束时间在8天后之内的的测试单的数量 + +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $oneDayLater, $today))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在今天之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $oneDayLater, $sixDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在6天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $oneDayLater, $sevenDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在7天后之内的的测试单的数量 +r(count($tester->testtask->fetchTesttaskList(1, 'all', 0, 'no', 'local', 'totalstatus', $oneDayLater, $eightDaysLater))) && p() && e('0'); // 查询产品ID为1的所有状态且开始时间在明天之后结束时间在8天后之内的的测试单的数量 + +r($tester->testtask->fetchTesttaskList(1)) && p('201:id,project,name,product,execution,build,owner,pri,desc,status,testreport,auto,deleted') && e('201,11,测试单1,1,101,11,user11,1,这是测试单描述201,wait,0,no,0'); // 验证产品ID为1,索引为201数据的所有字段 diff --git a/module/testtask/test/tao/yaml/fetchtesttasklist/execution.yaml b/module/testtask/test/tao/yaml/fetchtesttasklist/execution.yaml new file mode 100644 index 0000000000..c01c1e03cb --- /dev/null +++ b/module/testtask/test/tao/yaml/fetchtesttasklist/execution.yaml @@ -0,0 +1,75 @@ +title: table zt_execution +author: Zhu Jinyong +version: "1.0" +fields: + - field: id + range: 101-700 + - field: name + note: "名称" + fields: + - field: name1 + range: 迭代{30},阶段{30},看板{30} + - field: name2 + range: 1-10000 + - field: project + range: 11-100 + - field: model + range: [] + - field: type + range: sprint{30},stage{30},kanban{30} + - field: budget + range: 800000-1:100 + - field: status + range: wait,doing + - field: percent + range: 0{30},10{30},0{30} + - field: milestone + range: 0{30},1{10},0{10},1{10},0{30} + - field: auth + range: "extend" + - field: desc + range: 1-10000 + prefix: "迭代描述" + - field: begin + range: "(-2M)-(+M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: end + range: "(+1w)-(+2M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" + - field: grade + range: 1 + - field: parent + range: 11-40,41-70,71-100 + - field: path + fields: + - field: path1 + prefix: "," + range: 11-100 + - field: path2 + prefix: "," + range: 101-700 + postfix: "," + - field: acl + range: open{4},private{4} + - field: openedVersion + range: "16.5" + - field: whitelist + froms: + - from: common.user.v1.yaml + use: empty{8} + - from: common.user.v1.yaml + use: empty{8} + prefix: "," + - from: common.user.v1.yaml + use: one{8} + prefix: "," + - from: common.user.v1.yaml + use: two{8} + prefix: "," + - from: common.user.v1.yaml + use: three{8} + prefix: "," diff --git a/module/testtask/test/tao/yaml/fetchtesttasklist/product.yaml b/module/testtask/test/tao/yaml/fetchtesttasklist/product.yaml new file mode 100644 index 0000000000..3ddf63ec6b --- /dev/null +++ b/module/testtask/test/tao/yaml/fetchtesttasklist/product.yaml @@ -0,0 +1,6 @@ +title: table zt_product +author: Wang Yuting +version: "1.0" +fields: + - field: shadow + range: 0-1 diff --git a/module/testtask/test/tao/yaml/fetchtesttasklist/project.yaml b/module/testtask/test/tao/yaml/fetchtesttasklist/project.yaml new file mode 100644 index 0000000000..ce0ed88723 --- /dev/null +++ b/module/testtask/test/tao/yaml/fetchtesttasklist/project.yaml @@ -0,0 +1,6 @@ +title: table zt_project +author: Wang Yuting +version: "1.0" +fields: + - field: multiple + range: 0-1 diff --git a/module/testtask/ui/browseunits.html.php b/module/testtask/ui/browseunits.html.php index 9a44f93b03..3ffcb069a1 100644 --- a/module/testtask/ui/browseunits.html.php +++ b/module/testtask/ui/browseunits.html.php @@ -30,7 +30,7 @@ dtable set::page($pager->pageID), set::recPerPage($pager->recPerPage), set::recTotal($pager->recTotal), - set::linkCreator(helper::createLink('testtask', 'browseunits', "productID={$product->id}&browseType={$browseType}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}")) + set::linkCreator(helper::createLink('testtask', 'browseunits', "productID={$productID}&browseType={$browseType}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}")) ), );