From 891686e8f97f3e18f26c60ff1d0739404bc455b4 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Tue, 11 Jan 2022 13:55:01 +0800 Subject: [PATCH] * Fix ztest init. --- test/data/product.yaml | 2 +- test/data/program.yaml | 5 ++++- test/data/project.yaml | 6 +++--- test/data/zentao/config.php | 6 +++--- test/lib/utils.php | 6 ++++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/data/product.yaml b/test/data/product.yaml index 81677dc1a7..aed1457d67 100644 --- a/test/data/product.yaml +++ b/test/data/product.yaml @@ -7,7 +7,7 @@ fields: range: 1-1000 - field: program note: "所属项目集" - range: 1-40{3!},0{60},1-5,0{5},1-5,0{5} + range: 1-10 - field: name note: "产品名称" fields: diff --git a/test/data/program.yaml b/test/data/program.yaml index 5b5378a0a3..3e3430b23c 100644 --- a/test/data/program.yaml +++ b/test/data/program.yaml @@ -5,7 +5,7 @@ fields: - field: project range: 0 - field: model - range: "" + range: [] - field: name note: "名称" fields: @@ -19,6 +19,9 @@ fields: range: wait - field: parent range: 0 + - field: code + range: 1-10000 + prefix: "program" - field: desc range: 1-10000 prefix: "项目集描述" diff --git a/test/data/project.yaml b/test/data/project.yaml index da6d534838..0fec523f74 100644 --- a/test/data/project.yaml +++ b/test/data/project.yaml @@ -5,14 +5,14 @@ fields: - field: project range: 0 - field: model - range: "" + range: scrum{30},waterfall{30},kanban{30} - field: name note: "名称" fields: - field: name1 range: '项目' - field: name2 - range: []{100000} + range: 1-10000 - field: type range: project - field: lifetime @@ -36,7 +36,7 @@ fields: note: "Only project has auth" range: - field: parent - range: 1,2,3,4,2,1,[1-7]{2},[7-19]{3} + range: 1-10 - field: grade range: - field: code diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 9352cfc25a..0cdf8665b9 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -5,9 +5,9 @@ $builder->company = array('rows' => 1, 'extends' => array('company')); $builder->user = array('rows' => 1000, 'extends' => array('user')); $builder->dept = array('rows' => 100, 'extends' => array('dept')); -$builder->program = array('rows' => 100, 'extends' => array('project', 'program')); -$builder->project = array('rows' => 100, 'extends' => array('project', 'project')); -$builder->sprint = array('rows' => 200, 'extends' => array('project', 'execution')); +$builder->program = array('rows' => 10, 'extends' => array('project', 'program')); +$builder->project = array('rows' => 90, 'extends' => array('project', 'project')); +$builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution')); $builder->product = array('rows' => 100, 'extends' => array('product')); $builder->productplan = array('rows' => 360, 'extends' => array('productplan')); diff --git a/test/lib/utils.php b/test/lib/utils.php index 584f2c0894..fbe3b538cc 100644 --- a/test/lib/utils.php +++ b/test/lib/utils.php @@ -103,6 +103,7 @@ function zdRun() /* Generate SQL files. */ $tables = array(); + $count = 1; foreach($builder as $key => $info) { /* Build ZenData. */ @@ -166,12 +167,13 @@ function zdRun() /* Create SQL files. */ $tableName = $config->db->prefix . $tableName; - $command = "$zdPath -c %s -d %s -n %s -o {$zdRoot}sql/%s.sql -table %s"; - $execYaml = sprintf($command, $configYaml, $defaultFile, $info['rows'], $fileName, $tableName); + $command = "$zdPath -c %s -d %s -n %s -o {$zdRoot}sql/%03d_%s.sql -table %s"; + $execYaml = sprintf($command, $configYaml, $defaultFile, $info['rows'], $count, $fileName, $tableName); system($execYaml); // echo $execYaml . "\n"; $tables[$tableName] = $tableName; + $count++; } /* Truncate tables. */