Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
15b22d25
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
15b22d25
编写于
2月 24, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issue about commit independent expect results to zentao
上级
60771dc4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
17 deletion
+42
-17
internal/comm/helper/script/parser.go
internal/comm/helper/script/parser.go
+42
-12
internal/server/modules/v1/service/sync.go
internal/server/modules/v1/service/sync.go
+0
-5
未找到文件。
internal/comm/helper/script/parser.go
浏览文件 @
15b22d25
...
...
@@ -56,6 +56,20 @@ func GetStepAndExpectMap(file string) (stepMap, stepTypeMap, expectMap maps.Map,
_
,
stepMap
,
stepTypeMap
,
expectMap
=
getSortedTextFromNestedSteps
(
groupArr
)
}
isIndependent
,
expectIndependentContent
:=
GetDependentExpect
(
file
)
if
isIndependent
{
if
isOldFormat
{
expectMap
=
GetExpectMapFromIndependentFileObsolete
(
expectMap
,
expectIndependentContent
,
false
)
}
else
{
expectMap
=
GetExpectMapFromIndependentFile
(
expectMap
,
expectIndependentContent
,
false
)
}
}
return
}
func
GetExpectMap
(
file
string
)
(
expectMap
maps
.
Map
,
ok
bool
)
{
return
}
...
...
@@ -217,7 +231,7 @@ func parserNextLines(str string, nextLines []string) (ret commDomain.ZtfStep, in
}
if
len
(
expect
)
>
0
{
expect
+=
"
|
"
expect
+=
"
\r\n
"
}
expect
+=
strings
.
TrimSpace
(
line
)
}
...
...
@@ -581,8 +595,8 @@ func GetExpectMapFromIndependentFile(expectMap maps.Map, content string, withEmp
key
:=
strings
.
TrimSpace
(
keyIfs
.
(
string
))
value
:=
strings
.
TrimSpace
(
valueIfs
.
(
string
))
if
value
==
""
&&
len
(
expectArr
)
>
idx
{
retMap
.
Put
(
key
,
strings
.
Join
(
expectArr
[
idx
],
"
|
"
))
if
value
==
"
pass
"
&&
len
(
expectArr
)
>
idx
{
retMap
.
Put
(
key
,
strings
.
Join
(
expectArr
[
idx
],
"
\r\n
"
))
idx
++
}
else
{
if
withEmptyExpect
{
...
...
@@ -846,33 +860,47 @@ func ReadExpectIndependentArrObsolete(content string) [][]string {
}
func
ReadExpectIndependentArr
(
content
string
)
[][]
string
{
//正常显示6
//E2.16
//>>
// E2.2 - 16
// E2.2 - 26
//>>
//>>
// E3 - 16
// E3 - 26
//>>
lines
:=
strings
.
Split
(
content
,
"
\n
"
)
ret
:=
make
([][]
string
,
0
)
var
cpArr
[]
string
model
:=
""
for
idx
,
line
:=
range
lines
{
line
=
strings
.
TrimSpace
(
line
)
currModel
:=
""
idx
:=
0
for
idx
<
len
(
lines
)
{
line
:=
strings
.
TrimSpace
(
lines
[
idx
])
if
line
==
">>"
{
// more than one line
m
odel
=
"multi"
currM
odel
=
"multi"
cpArr
=
make
([]
string
,
0
)
}
else
if
m
odel
==
"multi"
{
// in >> and >> in multi line mode
}
else
if
currM
odel
==
"multi"
{
// in >> and >> in multi line mode
cpArr
=
append
(
cpArr
,
line
)
if
idx
==
len
(
lines
)
-
1
||
strings
.
Index
(
lines
[
idx
+
1
],
">>"
)
>
-
1
{
if
idx
==
len
(
lines
)
-
1
||
strings
.
Index
(
lines
[
idx
+
1
],
">>"
)
>
-
1
{
// end multi line
temp
:=
make
([]
string
,
0
)
temp
=
append
(
temp
,
strings
.
Join
(
cpArr
,
"
|
"
))
temp
=
append
(
temp
,
strings
.
Join
(
cpArr
,
"
\r\n
"
))
ret
=
append
(
ret
,
temp
)
cpArr
=
make
([]
string
,
0
)
model
=
""
currModel
=
""
idx
+=
1
}
}
else
if
line
==
">>"
{
continue
}
else
{
m
odel
=
"single"
currM
odel
=
"single"
line
=
strings
.
TrimSpace
(
line
)
...
...
@@ -880,6 +908,8 @@ func ReadExpectIndependentArr(content string) [][]string {
ret
=
append
(
ret
,
cpArr
)
cpArr
=
make
([]
string
,
0
)
}
idx
+=
1
}
return
ret
...
...
internal/server/modules/v1/service/sync.go
浏览文件 @
15b22d25
...
...
@@ -79,11 +79,6 @@ func (s *SyncService) SyncToZentao(projectPath string, commitProductId int) (err
logUtils
.
Infof
(
"isOldFormat = "
,
isOldFormat
)
}
isIndependent
,
expectIndependentContent
:=
scriptUtils
.
GetDependentExpect
(
cs
)
if
isIndependent
{
expectMap
=
scriptUtils
.
GetExpectMapFromIndependentFileObsolete
(
expectMap
,
expectIndependentContent
,
true
)
}
zentaoUtils
.
CommitCase
(
id
,
title
,
stepMap
,
stepTypeMap
,
expectMap
,
projectPath
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录