Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
ad2a0b6e
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 搜索 >>
提交
ad2a0b6e
编写于
5月 07, 2021
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename method for old script format
上级
c5e9ef30
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
24 deletion
+24
-24
src/action/case.go
src/action/case.go
+1
-1
src/service/testing/ztfCheck.go
src/service/testing/ztfCheck.go
+4
-4
src/utils/script/script.go
src/utils/script/script.go
+14
-14
src/utils/zentao/zentao.go
src/utils/zentao/zentao.go
+5
-5
未找到文件。
src/action/case.go
浏览文件 @
ad2a0b6e
...
...
@@ -20,7 +20,7 @@ func CommitCases(files []string) {
isIndependent
,
expectIndependentContent
:=
zentaoUtils
.
GetDependentExpect
(
cs
)
if
isIndependent
{
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
(
expectMap
,
expectIndependentContent
,
true
)
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
Obsolete
(
expectMap
,
expectIndependentContent
,
true
)
}
zentaoService
.
CommitCase
(
id
,
title
,
stepMap
,
stepTypeMap
,
expectMap
)
...
...
src/service/testing/ztfCheck.go
浏览文件 @
ad2a0b6e
...
...
@@ -22,18 +22,18 @@ func CheckCaseResult(file string, logs string, report *model.TestReport, idx int
isIndependent
,
expectIndependentContent
:=
zentaoUtils
.
GetDependentExpect
(
file
)
if
isIndependent
{
if
isOldFormat
{
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
(
expectMap
,
expectIndependentContent
,
false
)
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
Obsolete
(
expectMap
,
expectIndependentContent
,
false
)
}
else
{
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
New
(
expectMap
,
expectIndependentContent
,
false
)
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFile
(
expectMap
,
expectIndependentContent
,
false
)
}
}
skip
:=
false
actualArr
:=
make
([][]
string
,
0
)
if
isOldFormat
{
skip
,
actualArr
=
zentaoUtils
.
ReadLogArr
(
logs
)
skip
,
actualArr
=
zentaoUtils
.
ReadLogArr
Obsolete
(
logs
)
}
else
{
skip
,
actualArr
=
zentaoUtils
.
ReadLogArr
New
(
logs
)
skip
,
actualArr
=
zentaoUtils
.
ReadLogArr
(
logs
)
}
language
:=
langUtils
.
GetLangByFile
(
file
)
...
...
src/utils/script/script.go
浏览文件 @
ad2a0b6e
...
...
@@ -25,11 +25,11 @@ func GetStepAndExpectMap(file string) (stepMap, stepTypeMap, expectMap maps.Map,
if
isOldFormat
{
groupBlockArr
:=
getGroupBlockArr
(
lines
)
groupArr
:=
getStepNestedArr
(
groupBlockArr
)
_
,
stepMap
,
stepTypeMap
,
expectMap
=
getSortedTextFromNestedSteps
(
groupArr
)
groupArr
:=
getStepNestedArr
Obsolete
(
groupBlockArr
)
_
,
stepMap
,
stepTypeMap
,
expectMap
=
getSortedTextFromNestedSteps
Obsolete
(
groupArr
)
}
else
{
groupArr
:=
getStepNestedArr
New
(
lines
)
_
,
stepMap
,
stepTypeMap
,
expectMap
=
getSortedTextFromNestedSteps
New
(
groupArr
)
groupArr
:=
getStepNestedArr
(
lines
)
_
,
stepMap
,
stepTypeMap
,
expectMap
=
getSortedTextFromNestedSteps
(
groupArr
)
}
return
...
...
@@ -49,8 +49,8 @@ func SortFile(file string) {
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
groupBlockArr
:=
getGroupBlockArr
(
lines
)
groupArr
:=
getStepNestedArr
(
groupBlockArr
)
stepsTxt
,
_
,
_
,
_
=
getSortedTextFromNestedSteps
(
groupArr
)
groupArr
:=
getStepNestedArr
Obsolete
(
groupBlockArr
)
stepsTxt
,
_
,
_
,
_
=
getSortedTextFromNestedSteps
Obsolete
(
groupArr
)
// replace info
from
:=
""
...
...
@@ -112,7 +112,7 @@ func getGroupBlockArr(lines []string) [][]string {
return
groupBlockArr
}
func
getStepNestedArr
(
blocks
[][]
string
)
[]
model
.
TestStep
{
func
getStepNestedArr
Obsolete
(
blocks
[][]
string
)
[]
model
.
TestStep
{
ret
:=
make
([]
model
.
TestStep
,
0
)
for
_
,
block
:=
range
blocks
{
...
...
@@ -136,7 +136,7 @@ func getStepNestedArr(blocks [][]string) []model.TestStep {
return
ret
}
func
getStepNestedArr
New
(
lines
[]
string
)
(
ret
[]
model
.
TestStep
)
{
func
getStepNestedArr
(
lines
[]
string
)
(
ret
[]
model
.
TestStep
)
{
parent
:=
model
.
TestStep
{}
increase
:=
0
for
index
:=
0
;
index
<
len
(
lines
);
index
++
{
...
...
@@ -311,7 +311,7 @@ func isGroup(str string) bool {
return
ret
}
func
getSortedTextFromNestedSteps
(
groups
[]
model
.
TestStep
)
(
string
,
maps
.
Map
,
maps
.
Map
,
maps
.
Map
)
{
func
getSortedTextFromNestedSteps
Obsolete
(
groups
[]
model
.
TestStep
)
(
string
,
maps
.
Map
,
maps
.
Map
,
maps
.
Map
)
{
ret
:=
make
([]
string
,
0
)
stepMap
:=
linkedhashmap
.
New
()
stepTypeMap
:=
linkedhashmap
.
New
()
...
...
@@ -420,7 +420,7 @@ func getSortedTextFromNestedSteps(groups []model.TestStep) (string, maps.Map, ma
return
strings
.
Join
(
ret
,
"
\n
"
),
stepMap
,
stepTypeMap
,
expectMap
}
func
getSortedTextFromNestedSteps
New
(
groups
[]
model
.
TestStep
)
(
ret
string
,
stepMap
,
stepTypeMap
,
expectMap
maps
.
Map
)
{
func
getSortedTextFromNestedSteps
(
groups
[]
model
.
TestStep
)
(
ret
string
,
stepMap
,
stepTypeMap
,
expectMap
maps
.
Map
)
{
arr
:=
make
([]
string
,
0
)
stepMap
=
linkedhashmap
.
New
()
stepTypeMap
=
linkedhashmap
.
New
()
...
...
@@ -514,10 +514,10 @@ func printMutiStepOrExpect(str string) string {
return
strings
.
Join
(
ret
,
"
\r\n
"
)
}
func
GetExpectMapFromIndependentFile
(
expectMap
maps
.
Map
,
content
string
,
withEmptyExpect
bool
)
maps
.
Map
{
func
GetExpectMapFromIndependentFile
Obsolete
(
expectMap
maps
.
Map
,
content
string
,
withEmptyExpect
bool
)
maps
.
Map
{
retMap
:=
linkedhashmap
.
New
()
expectArr
:=
zentaoUtils
.
ReadExpectIndependentArr
(
content
)
expectArr
:=
zentaoUtils
.
ReadExpectIndependentArr
Obsolete
(
content
)
idx
:=
0
for
_
,
keyIfs
:=
range
expectMap
.
Keys
()
{
...
...
@@ -539,10 +539,10 @@ func GetExpectMapFromIndependentFile(expectMap maps.Map, content string, withEmp
return
retMap
}
func
GetExpectMapFromIndependentFile
New
(
expectMap
maps
.
Map
,
content
string
,
withEmptyExpect
bool
)
maps
.
Map
{
func
GetExpectMapFromIndependentFile
(
expectMap
maps
.
Map
,
content
string
,
withEmptyExpect
bool
)
maps
.
Map
{
retMap
:=
linkedhashmap
.
New
()
expectArr
:=
zentaoUtils
.
ReadExpectIndependentArr
New
(
content
)
expectArr
:=
zentaoUtils
.
ReadExpectIndependentArr
(
content
)
idx
:=
0
for
_
,
keyIfs
:=
range
expectMap
.
Keys
()
{
...
...
src/utils/zentao/zentao.go
浏览文件 @
ad2a0b6e
...
...
@@ -175,13 +175,13 @@ func GetCaseInfo(file string) (bool, int, int, string) {
// }
//
// if independentExpect {
// expectArr = ReadExpectIndependentArr(expectIndependentContent)
// expectArr = ReadExpectIndependentArr
Obsolete
(expectIndependentContent)
// }
//
// return cpStepArr, expectArr
//}
func
ReadExpectIndependentArr
(
content
string
)
[][]
string
{
func
ReadExpectIndependentArr
Obsolete
(
content
string
)
[][]
string
{
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
ret
:=
make
([][]
string
,
0
)
...
...
@@ -212,7 +212,7 @@ func ReadExpectIndependentArr(content string) [][]string {
return
ret
}
func
ReadExpectIndependentArr
New
(
content
string
)
[][]
string
{
func
ReadExpectIndependentArr
(
content
string
)
[][]
string
{
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
ret
:=
make
([][]
string
,
0
)
...
...
@@ -252,7 +252,7 @@ func ReadExpectIndependentArrNew(content string) [][]string {
return
ret
}
func
ReadLogArr
(
content
string
)
(
isSkip
bool
,
ret
[][]
string
)
{
func
ReadLogArr
Obsolete
(
content
string
)
(
isSkip
bool
,
ret
[][]
string
)
{
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
ret
=
make
([][]
string
,
0
)
...
...
@@ -297,7 +297,7 @@ func ReadLogArr(content string) (isSkip bool, ret [][]string) {
return
}
func
ReadLogArr
New
(
content
string
)
(
isSkip
bool
,
ret
[][]
string
)
{
func
ReadLogArr
(
content
string
)
(
isSkip
bool
,
ret
[][]
string
)
{
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
ret
=
make
([][]
string
,
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录