Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
0df2548c
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,发现更多精彩内容 >>
提交
0df2548c
编写于
2月 17, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main'
上级
dc1fa956
e41a81db
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
8 deletion
+39
-8
cmd/command/main.go
cmd/command/main.go
+8
-5
internal/comm/consts/var.go
internal/comm/consts/var.go
+2
-1
internal/comm/helper/exec/report-unit.go
internal/comm/helper/exec/report-unit.go
+0
-1
internal/comm/helper/exec/unit.go
internal/comm/helper/exec/unit.go
+3
-1
internal/command/action/unitTest.go
internal/command/action/unitTest.go
+26
-0
未找到文件。
cmd/command/main.go
浏览文件 @
0df2548c
...
...
@@ -19,6 +19,7 @@ import (
"github.com/sirupsen/logrus"
"os"
"os/signal"
"strings"
"syscall"
)
...
...
@@ -199,14 +200,16 @@ func run(args []string, actionModule *command.IndexModule) {
}
if
args
[
start
]
==
_consts
.
UnitTestToolMvn
{
commConsts
.
UnitTestTool
=
_consts
.
UnitTestToolMvn
commConsts
.
UnitTestTool
=
commConsts
.
JUnit
commConsts
.
UnitBuildTool
=
commConsts
.
Maven
}
else
if
args
[
start
]
==
_consts
.
UnitTestToolRobot
{
commConsts
.
UnitTestTool
=
_consts
.
UnitTestToolRobot
commConsts
.
UnitTestTool
=
commConsts
.
RobotFramework
commConsts
.
UnitBuildTool
=
commConsts
.
Maven
}
//cmd := strings.Join(args[start:], " ") todo unittest
//
//
action.RunUnitTest(cmd)
cmd
:=
strings
.
Join
(
args
[
start
:
],
" "
)
action
.
RunUnitTest
(
cmd
)
}
else
{
// func test
files
:=
fileUtils
.
GetFilesFromParams
(
args
[
2
:
])
...
...
internal/comm/consts/var.go
浏览文件 @
0df2548c
...
...
@@ -28,7 +28,8 @@ var (
ServerProjectDir
string
UnitTestType
string
UnitTestTool
string
UnitBuildTool
BuildTool
UnitTestTool
TestTool
UnitTestResult
string
UnitTestResults
=
"results"
ProductId
string
...
...
internal/comm/helper/exec/report-unit.go
浏览文件 @
0df2548c
...
...
@@ -161,7 +161,6 @@ func GenUnitTestReport(req serverDomain.WsReq, startTime, endTime int64,
resultPath
:=
filepath
.
Join
(
commConsts
.
ExecLogDir
,
commConsts
.
ResultText
)
msg
=
" "
+
i118Utils
.
Sprintf
(
"run_report"
,
resultPath
)
+
"
\n
"
sendExecMsg
(
msg
,
"false"
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
"false"
,
wsMsg
)
}
...
...
internal/comm/helper/exec/unit.go
浏览文件 @
0df2548c
...
...
@@ -99,7 +99,9 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st
for
{
line
,
err3
:=
reader1
.
ReadString
(
'\n'
)
if
line
!=
""
{
sendOutputMsg
(
line
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendOutputMsg
(
line
,
""
,
wsMsg
)
}
logUtils
.
ExecConsole
(
1
,
line
)
logUtils
.
ExecFile
(
line
)
...
...
internal/command/action/unitTest.go
0 → 100644
浏览文件 @
0df2548c
package
action
import
(
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
_scriptUtils
"github.com/aaronchen2k/deeptest/internal/comm/helper/exec"
stringUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/string"
serverDomain
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/kataras/iris/v12/websocket"
)
func
RunUnitTest
(
cmdStr
string
)
{
req
:=
serverDomain
.
WsReq
{
ProductId
:
commConsts
.
ProductId
,
ProjectPath
:
commConsts
.
WorkDir
,
Act
:
commConsts
.
ExecUnit
,
Cmd
:
cmdStr
,
TestTool
:
commConsts
.
UnitTestTool
,
BuildTool
:
commConsts
.
UnitBuildTool
,
}
if
stringUtils
.
ParseInt
(
req
.
ProductId
)
!=
0
{
req
.
SubmitResult
=
true
}
msg
:=
websocket
.
Message
{}
_scriptUtils
.
Exec
(
nil
,
nil
,
nil
,
req
,
msg
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录