Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
7b72e5ac
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 搜索 >>
提交
7b72e5ac
编写于
7月 15, 2022
作者:
Z
zhaoke
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'morden-ui' of github.com:easysoft/zentaoatf into morden-ui
上级
68b8f1ed
8f9db861
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
36 addition
and
12 deletion
+36
-12
cmd/command/main.go
cmd/command/main.go
+4
-1
internal/command/action/unitTest.go
internal/command/action/unitTest.go
+5
-1
internal/command/action/ztfResult.go
internal/command/action/ztfResult.go
+5
-1
internal/command/action/ztfTest.go
internal/command/action/ztfTest.go
+3
-3
internal/command/config/config.go
internal/command/config/config.go
+1
-1
internal/server/modules/v1/domain/test-exec.go
internal/server/modules/v1/domain/test-exec.go
+1
-0
internal/server/modules/v1/service/test-result.go
internal/server/modules/v1/service/test-result.go
+3
-1
pkg/lib/common/utils.go
pkg/lib/common/utils.go
+4
-1
res/doc/sample.txt
res/doc/sample.txt
+2
-2
ui/src/hooks/use-result-list.ts
ui/src/hooks/use-result-list.ts
+8
-1
未找到文件。
cmd/command/main.go
浏览文件 @
7b72e5ac
...
...
@@ -222,6 +222,9 @@ func runUnitTest(args []string) {
start
=
start
+
2
commConsts
.
ProductId
=
productId
}
if
taskIdOrName
!=
""
{
start
=
start
+
2
}
if
commConsts
.
Verbose
{
start
=
start
+
1
}
...
...
@@ -230,7 +233,7 @@ func runUnitTest(args []string) {
cmd
:=
strings
.
Join
(
args
[
start
:
],
" "
)
action
.
RunUnitTest
(
cmd
)
action
.
RunUnitTest
(
cmd
,
taskIdOrName
)
}
func
init
()
{
...
...
internal/command/action/unitTest.go
浏览文件 @
7b72e5ac
...
...
@@ -7,7 +7,7 @@ import (
stringUtils
"github.com/easysoft/zentaoatf/pkg/lib/string"
)
func
RunUnitTest
(
cmdStr
string
)
{
func
RunUnitTest
(
cmdStr
string
,
taskIdOrName
string
)
{
testSet
:=
serverDomain
.
TestSet
{
ProductId
:
stringUtils
.
ParseInt
(
commConsts
.
ProductId
),
WorkspacePath
:
commConsts
.
WorkDir
,
...
...
@@ -20,6 +20,10 @@ func RunUnitTest(cmdStr string) {
testSet
.
SubmitResult
=
true
}
if
taskIdOrName
!=
""
{
testSet
.
Name
=
taskIdOrName
}
req
:=
serverDomain
.
WsReq
{
Act
:
commConsts
.
ExecUnit
,
TestSets
:
[]
serverDomain
.
TestSet
{
testSet
},
...
...
internal/command/action/ztfResult.go
浏览文件 @
7b72e5ac
...
...
@@ -32,7 +32,7 @@ func CommitZTFTestResult(files []string, productId int, taskIdOrName string, noN
taskName
=
taskIdOrName
}
if
taskId
==
0
&&
!
noNeedConfirm
{
if
taskId
==
0
&&
taskName
==
""
&&
!
noNeedConfirm
{
taskIdStr
:=
stdinUtils
.
GetInput
(
"
\\
d*"
,
""
,
i118Utils
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
Sprintf
(
"task_id"
)
+
i118Utils
.
Sprintf
(
"task_id_empty_to_create"
))
...
...
@@ -51,6 +51,10 @@ func CommitZTFTestResult(files []string, productId int, taskIdOrName string, noN
return
}
if
taskName
!=
""
{
report
.
Name
=
taskName
}
config
:=
configHelper
.
LoadByWorkspacePath
(
commConsts
.
ZtfDir
)
err
=
zentaoHelper
.
CommitResult
(
report
,
result
.
ProductId
,
result
.
TaskId
,
config
,
nil
)
...
...
internal/command/action/ztfTest.go
浏览文件 @
7b72e5ac
...
...
@@ -11,7 +11,7 @@ import (
"path"
)
func
RunZTFTest
(
files
[]
string
,
moduleIdStr
,
suiteIdStr
,
taskId
Str
string
)
error
{
func
RunZTFTest
(
files
[]
string
,
moduleIdStr
,
suiteIdStr
,
taskId
OrName
string
)
error
{
req
:=
serverDomain
.
WsReq
{
ScriptDirParamFromCmdLine
:
files
[
0
],
}
...
...
@@ -28,8 +28,8 @@ func RunZTFTest(files []string, moduleIdStr, suiteIdStr, taskIdStr string) error
testSet
.
SuiteId
=
stringUtils
.
ParseInt
(
suiteIdStr
)
req
.
Act
=
commConsts
.
ExecSuite
}
else
if
taskId
Str
!=
""
{
// run with task id,
testSet
.
TaskId
=
stringUtils
.
ParseInt
(
taskId
Str
)
}
else
if
taskId
OrName
!=
""
&&
stringUtils
.
ParseInt
(
taskIdOrName
)
>
0
{
// run with task id,
testSet
.
TaskId
=
stringUtils
.
ParseInt
(
taskId
OrName
)
req
.
Act
=
commConsts
.
ExecTask
}
else
{
...
...
internal/command/config/config.go
浏览文件 @
7b72e5ac
...
...
@@ -28,7 +28,7 @@ func InitConfig() {
commConsts
.
WorkDir
=
fileUtils
.
GetWorkDir
()
commConsts
.
ZtfDir
=
fileUtils
.
GetZTFDir
()
if
commConsts
.
Verbo
se
{
if
!
commConsts
.
IsRelea
se
{
log
.
Println
(
"WorkDir="
+
commConsts
.
WorkDir
)
log
.
Println
(
"ZtfDir="
+
commConsts
.
ZtfDir
)
}
...
...
internal/server/modules/v1/domain/test-exec.go
浏览文件 @
7b72e5ac
...
...
@@ -10,6 +10,7 @@ type TestExecReq struct {
}
type
TestReportSummary
struct
{
Name
string
`json:"name"`
No
string
`json:"no"`
Seq
string
`json:"seq"`
TestEnv
commConsts
.
OsType
`json:"testEnv,omitempty"`
...
...
internal/server/modules/v1/service/test-result.go
浏览文件 @
7b72e5ac
...
...
@@ -41,7 +41,9 @@ func (s *TestResultService) Paginate(siteId, productId uint, req serverDomain.Re
for
_
,
workspace
:=
range
workspaces
{
reportSeqs
:=
analysisHelper
.
ListReport2
(
workspace
.
Path
,
maxSize
)
for
_
,
seq
:=
range
reportSeqs
{
summary
:=
serverDomain
.
TestReportSummary
{
WorkspaceId
:
int
(
workspace
.
ID
)}
summary
:=
serverDomain
.
TestReportSummary
{
WorkspaceId
:
int
(
workspace
.
ID
),
}
report
,
_
,
err1
:=
analysisHelper
.
ReadReportByWorkspaceSeq
(
workspace
.
Path
,
seq
)
if
err1
!=
nil
{
// ignore wrong json result
...
...
pkg/lib/common/utils.go
浏览文件 @
7b72e5ac
...
...
@@ -93,7 +93,10 @@ func IsRelease() bool {
arg1
:=
strings
.
ToLower
(
os
.
Args
[
0
])
name
:=
filepath
.
Base
(
arg1
)
return
strings
.
Index
(
name
,
"___"
)
!=
0
&&
strings
.
Index
(
name
,
"go-build"
)
!=
0
ret
:=
strings
.
Index
(
arg1
,
"go-build"
)
<
0
&&
strings
.
Index
(
name
,
"___"
)
!=
0
&&
strings
.
Index
(
name
,
"go-build"
)
!=
0
return
ret
}
func
GetUserHome
()
string
{
...
...
res/doc/sample.txt
浏览文件 @
7b72e5ac
...
...
@@ -11,8 +11,8 @@ $>ztf.exe run product01 product01\all.cs 执行all.cs测试套件的
$>ztf.exe run log\001\result.txt 执行result.txt结果文件中的失败用例。
$>ztf.exe run product01 -suite 1 执行禅道系统中编号为1的套件,脚本在product01目录,缩写-s。
$>ztf.exe run -task 1 执行禅道系统中编号为1的任务,脚本在当期目录, 缩写-t。
$>ztf.exe run demo\demo -p 1 -
cr -cb
执行目录demo下的脚本,完成后提交结果到禅道,并将失败结果提交成缺陷。
cr提交结果,-cb提交缺陷
,-p必填参数指定产品ID
$>ztf.exe run demo\demo -p 1 -
t task1 -cr -cb
执行目录demo下的脚本,完成后提交结果到禅道,并将失败结果提交成缺陷。
cr提交结果,-cb提交缺陷
; -p必填参数指定产品ID, -t可选参数指定禅道新建测试单名称。
$>ztf.exe run demo\autoit 执行ZTF自带AutoIT脚本。
$>ztf.exe run demo\selenium\chrome.php --interp runtime\php\php7\php.exe
...
...
ui/src/hooks/use-result-list.ts
浏览文件 @
7b72e5ac
...
...
@@ -28,7 +28,14 @@ interface TestResultInfo {
export
default
function
useResultList
():
{
results
:
ComputedRef
<
TestResultInfo
[]
>
,
fetchResults
:
()
=>
void
}
{
const
store
=
useStore
<
{
Zentao
:
ZentaoData
,
Result
:
StateType
}
>
();
const
results
=
computed
<
any
[]
>
(()
=>
store
.
state
.
Result
.
queryResult
.
result
?.
map
((
item
)
=>
({...
item
,
displayName
:
item
.
total
!=
1
?
item
.
workspaceName
+
'
(
'
+
item
.
total
+
'
)
'
:
item
.
testScriptName
})));
const
results
=
computed
<
any
[]
>
(()
=>
store
.
state
.
Result
.
queryResult
.
result
?.
map
((
item
)
=>
{
const
displayName
=
item
.
testType
===
"
unit
"
||
item
.
total
!=
1
?
item
.
workspaceName
+
'
(
'
+
item
.
total
+
'
)
'
:
item
.
testScriptName
return
{
...
item
,
displayName
:
displayName
}
}));
const
currentProduct
=
useCurrentProduct
();
const
pagination
=
computed
<
PaginationConfig
>
(()
=>
store
.
state
.
Result
.
queryResult
.
pagination
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录