Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
8c4fa216
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
8 个月 前同步成功
通知
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 搜索 >>
提交
8c4fa216
编写于
6月 30, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a issue
上级
737faca9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
28 deletion
+25
-28
res/doc/sample.txt
res/doc/sample.txt
+2
-2
src/action/ztfResult.go
src/action/ztfResult.go
+2
-2
src/service/client/http.go
src/service/client/http.go
+0
-11
src/service/testing/ztfTestReport.go
src/service/testing/ztfTestReport.go
+2
-1
src/service/zentao/testResult.go
src/service/zentao/testResult.go
+4
-4
src/service/zentao/ztfTestResult.go
src/service/zentao/ztfTestResult.go
+13
-6
src/ztf.go
src/ztf.go
+2
-2
未找到文件。
res/doc/sample.txt
浏览文件 @
8c4fa216
...
...
@@ -22,8 +22,8 @@ $>ztf.exe junit -p 1 mvn clean package test 执行junit单元测试脚
更多请参照https://www.ztesting.net/book/ztf-doc/junit-33.html
$>ztf.exe ci product01\tc-1.py 将脚本里修改的用例信息,同步到禅道系统。
$>ztf.exe cr log\001
提交测试结果到禅道系统
。
$>ztf.exe cr
-r log\001 提交测试结果到禅道系统,不需要逐个
确认。
$>ztf.exe cr log\001
-p 1 提交测试结果到禅道系统编号为1的产品
。
$>ztf.exe cr
log\001 -p 1 -t 1 -y 提交测试结果到禅道系统。使用-t提供TaskID、或-y忽略确认时,不需要
确认。
$>ztf.exe cb log\001 提交测试结果中失败用例为缺陷。
$>ztf.exe list demo\lang\bat 列出目录bat下的所有脚本文件,支持多个目录和文件参数项。
...
...
src/action/ztfResult.go
浏览文件 @
8c4fa216
...
...
@@ -6,7 +6,7 @@ import (
stdinUtils
"github.com/easysoft/zentaoatf/src/utils/stdin"
)
func
CommitZTFTestResult
(
files
[]
string
,
noNeedConfirm
bool
)
{
func
CommitZTFTestResult
(
files
[]
string
,
productId
string
,
taskId
string
,
noNeedConfirm
bool
)
{
var
resultDir
string
if
len
(
files
)
>
0
{
resultDir
=
files
[
0
]
...
...
@@ -15,5 +15,5 @@ func CommitZTFTestResult(files []string, noNeedConfirm bool) {
}
resultDir
=
fileUtils
.
UpdateDir
(
resultDir
)
zentaoService
.
CommitZTFTestResult
(
resultDir
,
noNeedConfirm
)
zentaoService
.
CommitZTFTestResult
(
resultDir
,
productId
,
taskId
,
noNeedConfirm
)
}
src/service/client/http.go
浏览文件 @
8c4fa216
...
...
@@ -35,17 +35,6 @@ func Get(url string) (string, bool) {
return
""
,
false
}
//req.Header.Set("cookie", vari.SessionVar+"="+vari.SessionId)
//
//q := req.URL.Query()
//q.Add(vari.SessionVar, vari.SessionId)
//if params != nil {
// for pkey, pval := range params {
// q.Add(pkey, pval)
// }
//}
//req.URL.RawQuery = q.Encode()
resp
,
respErr
:=
client
.
Do
(
req
)
if
respErr
!=
nil
{
if
vari
.
Verbose
{
...
...
src/service/testing/ztfTestReport.go
浏览文件 @
8c4fa216
...
...
@@ -11,6 +11,7 @@ import (
"github.com/easysoft/zentaoatf/src/utils/vari"
"github.com/fatih/color"
"github.com/mattn/go-runewidth"
"strconv"
"strings"
"time"
)
...
...
@@ -108,7 +109,7 @@ func GenZTFTestReport(report model.TestReport, pathMaxWidth int) {
))
//println("===" + vari.LogDir)
report
.
ProductId
,
_
=
strconv
.
Atoi
(
vari
.
ProductId
)
json
,
_
:=
json
.
Marshal
(
report
)
fileUtils
.
WriteFile
(
vari
.
LogDir
+
"result.json"
,
string
(
json
))
}
src/service/zentao/testResult.go
浏览文件 @
8c4fa216
...
...
@@ -16,12 +16,12 @@ import (
)
func
CommitTestResult
(
report
model
.
TestReport
,
testTaskId
int
)
{
if
len
(
report
.
FuncResult
)
>
0
&&
vari
.
ProductId
==
""
{
vari
.
ProductId
=
strconv
.
Itoa
(
report
.
FuncResult
[
0
]
.
ProductId
)
}
//
if len(report.FuncResult) > 0 && vari.ProductId == "" {
//
vari.ProductId = strconv.Itoa(report.FuncResult[0].ProductId)
//
}
if
vari
.
ProductId
==
""
{
logUtils
.
Screen
(
i118Utils
.
I118Prt
.
Sprintf
(
"ignore_to_submit_result"
))
logUtils
.
Screen
(
color
.
CyanString
(
i118Utils
.
I118Prt
.
Sprintf
(
"ignore_to_submit_result"
)
))
return
}
...
...
src/service/zentao/ztfTestResult.go
浏览文件 @
8c4fa216
...
...
@@ -5,19 +5,26 @@ import (
configUtils
"github.com/easysoft/zentaoatf/src/utils/config"
i118Utils
"github.com/easysoft/zentaoatf/src/utils/i118"
stdinUtils
"github.com/easysoft/zentaoatf/src/utils/stdin"
"github.com/easysoft/zentaoatf/src/utils/vari"
"strconv"
)
func
CommitZTFTestResult
(
resultDir
string
,
noNeedConfirm
bool
)
{
func
CommitZTFTestResult
(
resultDir
string
,
productId
string
,
taskId
string
,
noNeedConfirm
bool
)
{
conf
:=
configUtils
.
ReadCurrConfig
()
Login
(
conf
.
Url
,
conf
.
Account
,
conf
.
Password
)
report
:=
testingService
.
GetZTFTestReportForSubmit
(
resultDir
)
task
:=
stdinUtils
.
GetInput
(
"
\\
d*"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id"
)
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id_empty_to_create"
))
if
vari
.
ProductId
==
""
&&
productId
!=
""
{
vari
.
ProductId
=
productId
}
testTask
,
_
:=
strconv
.
Atoi
(
task
)
CommitTestResult
(
report
,
testTask
)
if
taskId
==
""
&&
!
noNeedConfirm
{
taskId
=
stdinUtils
.
GetInput
(
"
\\
d*"
,
""
,
i118Utils
.
I118Prt
.
Sprintf
(
"pls_enter"
)
+
" "
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id"
)
+
i118Utils
.
I118Prt
.
Sprintf
(
"task_id_empty_to_create"
))
}
taskIdInt
,
_
:=
strconv
.
Atoi
(
taskId
)
CommitTestResult
(
report
,
taskIdInt
)
}
\ No newline at end of file
src/ztf.go
浏览文件 @
8c4fa216
...
...
@@ -104,7 +104,7 @@ func main() {
case
"cr"
:
files
:=
fileUtils
.
GetFilesFromParams
(
os
.
Args
[
2
:
])
if
err
:=
flagSet
.
Parse
(
os
.
Args
[
len
(
files
)
+
2
:
]);
err
==
nil
{
action
.
CommitZTFTestResult
(
files
,
noNeedConfirm
)
action
.
CommitZTFTestResult
(
files
,
productId
,
taskId
,
noNeedConfirm
)
}
case
"cb"
:
...
...
@@ -158,7 +158,7 @@ func main() {
func
run
(
args
[]
string
)
{
if
len
(
args
)
>=
3
&&
stringUtils
.
FindInArr
(
args
[
2
],
constant
.
UnitTestType
)
{
// unit test
// junit
-p 1 mvn clean package test
// junit -p 1 mvn clean package test
vari
.
UnitTestType
=
args
[
2
]
end
:=
8
if
end
>
len
(
args
)
-
1
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录