Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
201c7317
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
201c7317
编写于
9月 04, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stdin
上级
929fd22b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
31 deletion
+32
-31
src/action/case.go
src/action/case.go
+1
-1
src/service/script/assert.go
src/service/script/assert.go
+15
-14
src/service/testing/check.go
src/service/testing/check.go
+1
-1
src/utils/stdin/stdin.go
src/utils/stdin/stdin.go
+12
-12
src/utils/zentao/zentao.go
src/utils/zentao/zentao.go
+3
-3
未找到文件。
src/action/case.go
浏览文件 @
201c7317
...
...
@@ -7,7 +7,7 @@ import (
func
CommitCases
(
files
[]
string
)
{
for
_
,
file
:=
range
files
{
id
,
_
,
title
:=
zentaoUtils
.
GetCaseInfo
(
file
)
_
,
id
,
_
,
title
:=
zentaoUtils
.
GetCaseInfo
(
file
)
zentaoService
.
CommitCase
(
id
,
title
)
}
}
src/service/script/assert.go
浏览文件 @
201c7317
...
...
@@ -25,10 +25,10 @@ func GetAllScriptsInDir(filePth string, files *[]string) error {
pass
,
_
:=
regexp
.
MatchString
(
"^*.
\\
."
+
regx
+
"$"
,
filePth
)
if
pass
{
//id, _, _ := zentaoUtils.GetCaseInfo
(filePth)
//if id > 0
{
*
files
=
append
(
*
files
,
filePth
)
//
}
pass
:=
zentaoUtils
.
CheckFileIsScript
(
filePth
)
if
pass
{
*
files
=
append
(
*
files
,
filePth
)
}
}
return
nil
...
...
@@ -53,10 +53,10 @@ func GetAllScriptsInDir(filePth string, files *[]string) error {
pass
,
_
:=
regexp
.
MatchString
(
"^*.
\\
."
+
regx
+
"$"
,
path
)
if
pass
{
//id, _, _ := zentaoUtils.GetCaseInfo(pa
th)
//if id > 0
{
*
files
=
append
(
*
files
,
path
)
//
}
pass
:=
zentaoUtils
.
CheckFileIsScript
(
fileP
th
)
if
pass
{
*
files
=
append
(
*
files
,
path
)
}
}
}
}
...
...
@@ -91,14 +91,15 @@ func GetScriptByIdsInDir(dirPth string, idMap map[int]string, files *[]string) e
}
path
:=
dirPth
+
name
id
,
_
,
_
:=
zentaoUtils
.
GetCaseInfo
(
path
)
//if id > 0 {
_
,
ok
:=
idMap
[
id
]
if
ok
{
*
files
=
append
(
*
files
,
path
)
pass
,
id
,
_
,
_
:=
zentaoUtils
.
GetCaseInfo
(
path
)
if
pass
{
_
,
ok
:=
idMap
[
id
]
if
ok
{
*
files
=
append
(
*
files
,
path
)
}
}
//}
}
}
...
...
src/service/testing/check.go
浏览文件 @
201c7317
...
...
@@ -27,7 +27,7 @@ func ValidateCaseResult(scriptFile string, langType string,
checkpointStepArr
[]
string
,
expectArr
[][]
string
,
skip
bool
,
actualArr
[][]
string
,
report
*
model
.
TestReport
,
idx
int
,
total
int
)
{
caseId
,
productId
,
title
:=
zentaoUtils
.
GetCaseInfo
(
scriptFile
)
_
,
caseId
,
productId
,
title
:=
zentaoUtils
.
GetCaseInfo
(
scriptFile
)
stepLogs
:=
make
([]
model
.
StepLog
,
0
)
caseResult
:=
constant
.
PASS
.
String
()
...
...
src/utils/stdin/stdin.go
浏览文件 @
201c7317
...
...
@@ -30,10 +30,10 @@ func InputForCheckout(productId *string, moduleId *string, suiteId *string, task
productCheck
=
"*"
numb
=
"1"
}
else
if
*
suiteId
!=
""
{
modul
eCheck
=
"*"
suit
eCheck
=
"*"
numb
=
"3"
}
else
if
*
taskId
!=
""
{
module
Check
=
"*"
task
Check
=
"*"
numb
=
"4"
}
...
...
@@ -41,22 +41,22 @@ func InputForCheckout(productId *string, moduleId *string, suiteId *string, task
coType
=
strings
.
ToLower
(
coType
)
if
coType
==
"1"
{
*
productId
=
GetInput
(
"
\\
d+"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"product_id"
))
*
productId
=
GetInput
(
"
\\
d+"
,
*
productId
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"product_id"
)
+
": "
+*
productId
)
}
else
if
coType
==
"2"
{
*
productId
=
GetInput
(
"
\\
d+"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"product_id"
))
*
productId
=
GetInput
(
"
\\
d+"
,
*
productId
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"product_id"
)
+
": "
+*
productId
)
*
moduleId
=
GetInput
(
"
\\
d+"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"module_id"
))
*
moduleId
=
GetInput
(
"
\\
d+"
,
*
moduleId
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"module_id"
)
+
": "
+*
moduleId
)
}
else
if
coType
==
"3"
{
*
suiteId
=
GetInput
(
"
\\
d+"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"suite_id"
))
*
suiteId
=
GetInput
(
"
\\
d+"
,
*
suiteId
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"suite_id"
)
+
": "
+*
suiteId
)
}
else
if
coType
==
"4"
{
*
taskId
=
GetInput
(
"
\\
d+"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id"
))
*
taskId
=
GetInput
(
"
\\
d+"
,
*
taskId
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id"
)
+
": "
+*
taskId
)
}
InputForBool
(
independentFile
,
false
,
"enter_co_independent"
)
...
...
src/utils/zentao/zentao.go
浏览文件 @
201c7317
...
...
@@ -81,7 +81,7 @@ func RunDateFolder() string {
return
runName
}
func
GetCaseInfo
(
file
string
)
(
int
,
int
,
string
)
{
func
GetCaseInfo
(
file
string
)
(
bool
,
int
,
int
,
string
)
{
var
caseId
int
var
productId
int
var
title
string
...
...
@@ -90,7 +90,7 @@ func GetCaseInfo(file string) (int, int, string) {
pass
:=
CheckFileContentIsScript
(
content
)
if
!
pass
{
return
caseId
,
productId
,
title
return
false
,
caseId
,
productId
,
title
}
myExp
:=
regexp
.
MustCompile
(
`[\S\s]*caseId:\s*([^\n]*?)\s*\n`
)
...
...
@@ -111,7 +111,7 @@ func GetCaseInfo(file string) (int, int, string) {
title
=
arr
[
1
]
}
return
caseId
,
productId
,
title
return
pass
,
caseId
,
productId
,
title
}
func
ReadExpect
(
file
string
)
[][]
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录