Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
10d09544
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
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 搜索 >>
提交
10d09544
编写于
2月 09, 2022
作者:
m0_58228130
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ztfTest
上级
0ddd45ee
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
256 addition
and
33 deletion
+256
-33
cmd/command/main.go
cmd/command/main.go
+1
-1
internal/agent/core/viper/index.go
internal/agent/core/viper/index.go
+13
-13
internal/comm/consts/var.go
internal/comm/consts/var.go
+1
-0
internal/comm/vari/var.go
internal/comm/vari/var.go
+3
-1
internal/command/action/ztfTest.go
internal/command/action/ztfTest.go
+157
-0
internal/command/config/config.go
internal/command/config/config.go
+1
-1
internal/server/modules/utils/exec/report-unit.go
internal/server/modules/utils/exec/report-unit.go
+22
-5
internal/server/modules/utils/exec/report-ztf.go
internal/server/modules/utils/exec/report-ztf.go
+13
-3
internal/server/modules/utils/exec/result.go
internal/server/modules/utils/exec/result.go
+4
-1
internal/server/modules/utils/exec/unit.go
internal/server/modules/utils/exec/unit.go
+16
-3
internal/server/modules/utils/exec/ztf.go
internal/server/modules/utils/exec/ztf.go
+25
-5
未找到文件。
cmd/command/main.go
浏览文件 @
10d09544
...
...
@@ -168,7 +168,7 @@ func run(args []string) {
if
vari
.
Interpreter
!=
""
{
logUtils
.
PrintToWithColor
(
i118Utils
.
Sprintf
(
"run_with_specific_interpreter"
,
vari
.
Interpreter
),
color
.
FgCyan
)
}
//
action.RunZTFTest(files, suiteId, taskId)
action
.
RunZTFTest
(
files
,
suiteId
,
taskId
)
}
else
{
resUtils
.
PrintUsage
()
}
...
...
internal/agent/core/viper/index.go
浏览文件 @
10d09544
...
...
@@ -3,7 +3,7 @@ package agentViper
import
(
"bytes"
"fmt"
"github.com/aaronchen2k/deeptest/internal/agent/consts
"
agentConfig
"github.com/aaronchen2k/deeptest/internal/agent/config
"
"github.com/aaronchen2k/deeptest/internal/pkg/consts"
myZap
"github.com/aaronchen2k/deeptest/internal/pkg/core/zap"
"github.com/fsnotify/fsnotify"
...
...
@@ -19,8 +19,8 @@ func Init() {
fmt
.
Printf
(
"配置文件路径为%s
\n
"
,
config
)
v
:=
viper
.
New
()
agentCon
sts
.
VIPER
=
v
agentCon
sts
.
VIPER
.
SetConfigType
(
"yaml"
)
agentCon
fig
.
VIPER
=
v
agentCon
fig
.
VIPER
.
SetConfigType
(
"yaml"
)
if
!
dir
.
IsExist
(
config
)
{
//没有配置文件,写入默认配置
var
yamlDefault
=
[]
byte
(
`
...
...
@@ -39,38 +39,38 @@ zap:
stacktrace-key: stacktrace
log-in-console: true`
)
if
err
:=
agentCon
sts
.
VIPER
.
ReadConfig
(
bytes
.
NewBuffer
(
yamlDefault
));
err
!=
nil
{
if
err
:=
agentCon
fig
.
VIPER
.
ReadConfig
(
bytes
.
NewBuffer
(
yamlDefault
));
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"读取默认配置文件错误: %w "
,
err
))
}
if
err
:=
agentCon
sts
.
VIPER
.
Unmarshal
(
&
agentConsts
.
CONFIG
);
err
!=
nil
{
if
err
:=
agentCon
fig
.
VIPER
.
Unmarshal
(
&
agentConfig
.
CONFIG
);
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"同步配置文件错误: %w "
,
err
))
}
if
err
:=
agentCon
sts
.
VIPER
.
WriteConfigAs
(
config
);
err
!=
nil
{
if
err
:=
agentCon
fig
.
VIPER
.
WriteConfigAs
(
config
);
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"写入配置文件错误: %w "
,
err
))
}
return
}
// 存在配置文件,读取配置文件内容
agentCon
sts
.
VIPER
.
SetConfigFile
(
config
)
err
:=
agentCon
sts
.
VIPER
.
ReadInConfig
()
agentCon
fig
.
VIPER
.
SetConfigFile
(
config
)
err
:=
agentCon
fig
.
VIPER
.
ReadInConfig
()
if
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"读取配置错误: %w "
,
err
))
}
// 监控配置文件变化
agentCon
sts
.
VIPER
.
WatchConfig
()
agentCon
sts
.
VIPER
.
OnConfigChange
(
func
(
e
fsnotify
.
Event
)
{
agentCon
fig
.
VIPER
.
WatchConfig
()
agentCon
fig
.
VIPER
.
OnConfigChange
(
func
(
e
fsnotify
.
Event
)
{
fmt
.
Println
(
"配置发生变化:"
,
e
.
Name
)
if
err
:=
agentCon
sts
.
VIPER
.
Unmarshal
(
&
agentConsts
.
CONFIG
);
err
!=
nil
{
if
err
:=
agentCon
fig
.
VIPER
.
Unmarshal
(
&
agentConfig
.
CONFIG
);
err
!=
nil
{
fmt
.
Println
(
err
)
}
})
if
err
:=
v
.
Unmarshal
(
&
agentCon
sts
.
CONFIG
);
err
!=
nil
{
if
err
:=
v
.
Unmarshal
(
&
agentCon
fig
.
CONFIG
);
err
!=
nil
{
fmt
.
Println
(
err
)
}
myZap
.
ZapInst
=
agentCon
sts
.
CONFIG
.
Zap
myZap
.
ZapInst
=
agentCon
fig
.
CONFIG
.
Zap
}
internal/comm/consts/var.go
浏览文件 @
10d09544
...
...
@@ -13,4 +13,5 @@ var (
SessionId
string
SessionVar
string
RequestFix
string
ComeFrom
=
"cmd"
)
internal/comm/vari/var.go
浏览文件 @
10d09544
package
vari
import
commDomain
"github.com/aaronchen2k/deeptest/internal/comm/domain"
var
(
IsDebug
bool
//Config = model.Config
{}
Config
=
commDomain
.
ProjectConf
{}
//Cui *gocui.Gui
MainViewHeight
int
...
...
internal/command/action/ztfTest.go
0 → 100644
浏览文件 @
10d09544
package
action
import
(
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
"github.com/aaronchen2k/deeptest/internal/comm/vari"
"github.com/aaronchen2k/deeptest/internal/pkg/consts"
fileUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/file"
i118Utils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/i118"
logUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/log"
serverLog
"github.com/aaronchen2k/deeptest/internal/server/core/log"
_scriptUtils
"github.com/aaronchen2k/deeptest/internal/server/modules/utils/exec"
scriptUtils
"github.com/aaronchen2k/deeptest/internal/server/modules/utils/script"
serverDomain
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/kataras/iris/v12/websocket"
"path"
"strconv"
)
func
RunZTFTest
(
files
[]
string
,
suiteIdStr
,
taskIdStr
string
)
error
{
serverLog
.
Init
()
cases
:=
make
([]
string
,
0
)
if
suiteIdStr
!=
""
{
// run with suite id
dir
:=
fileUtils
.
AbsolutePath
(
"."
)
if
vari
.
ServerProjectDir
!=
""
{
dir
=
vari
.
ServerProjectDir
}
else
if
len
(
files
)
>
0
{
dir
=
files
[
0
]
}
cases
=
getCaseBySuiteId
(
suiteIdStr
,
dir
)
}
else
if
taskIdStr
!=
""
{
// run with task id,
dir
:=
fileUtils
.
AbsolutePath
(
"."
)
if
vari
.
ServerProjectDir
!=
""
{
dir
=
vari
.
ServerProjectDir
}
else
if
len
(
files
)
>
0
{
dir
=
files
[
0
]
}
cases
=
getCaseByTaskId
(
taskIdStr
,
dir
)
}
else
{
suite
,
dir
:=
isRunWithSuiteFile
(
files
)
result
:=
isRunWithResultFile
(
files
)
if
suite
!=
""
{
// run from suite file
if
dir
==
""
{
// not found dir in files param
dir
=
fileUtils
.
AbsolutePath
(
"."
)
if
vari
.
ServerProjectDir
!=
""
{
dir
=
vari
.
ServerProjectDir
}
}
cases
=
getCaseBySuiteFile
(
suite
,
dir
)
}
else
if
result
!=
""
{
// run from failed result file
//cases = assertUtils.GetFailedCasesDirectlyFromTestResult(result)
scriptTree
,
_
:=
scriptUtils
.
LoadScriptTree
(
commConsts
.
WorkDir
)
cases
=
GetCasesFromChildren
(
scriptTree
.
Children
)
}
else
{
// run files
//cases = assertUtils.GetCaseByDirAndFile(files)
scriptTree
,
_
:=
scriptUtils
.
LoadScriptTree
(
commConsts
.
WorkDir
)
cases
=
GetCasesFromChildren
(
scriptTree
.
Children
)
}
}
if
len
(
cases
)
<
1
{
logUtils
.
PrintTo
(
"
\n
"
+
i118Utils
.
Sprintf
(
"no_cases"
))
return
nil
}
//runCases(cases)
req
:=
serverDomain
.
WsReq
{
Cases
:
cases
,
Act
:
commConsts
.
ExecCase
,
}
msg
:=
websocket
.
Message
{}
_scriptUtils
.
Exec
(
nil
,
nil
,
nil
,
req
,
msg
)
return
nil
}
func
getCaseBySuiteId
(
id
string
,
dir
string
)
[]
string
{
// todo
//caseIdMap := map[int]string{}
cases
:=
make
([]
string
,
0
)
//suiteId, err := strconv.Atoi(id)
return
cases
}
func
getCaseBySuiteFile
(
file
string
,
dir
string
)
[]
string
{
//caseIdMap := map[int]string{}
cases
:=
make
([]
string
,
0
)
//assertUtils.GetCaseIdsInSuiteFile(file, &caseIdMap)
//assertUtils.GetScriptByIdsInDir(dir, caseIdMap, &cases)
return
cases
}
func
getCaseByTaskId
(
id
string
,
dir
string
)
[]
string
{
//caseIdMap := map[int]string{}
cases
:=
make
([]
string
,
0
)
taskId
,
err
:=
strconv
.
Atoi
(
id
)
if
err
==
nil
&&
taskId
>
0
{
//configUtils.CheckRequestConfig()
//zentaoService.GetCaseIdsByTask(id, &caseIdMap)
}
//assertUtils.GetScriptByIdsInDir(dir, caseIdMap, &cases)
return
cases
}
func
isRunWithSuiteFile
(
files
[]
string
)
(
suiteFile
,
dir
string
)
{
for
_
,
file
:=
range
files
{
if
path
.
Ext
(
file
)
==
"."
+
consts
.
ExtNameSuite
{
suiteFile
=
file
}
else
{
if
dir
==
""
{
// only select the first dir
dir
=
file
}
}
if
suiteFile
!=
""
&&
dir
!=
""
{
break
}
}
return
}
func
isRunWithResultFile
(
files
[]
string
)
string
{
var
resultFile
string
for
_
,
file
:=
range
files
{
if
path
.
Ext
(
file
)
==
"."
+
consts
.
ExtNameResult
||
path
.
Ext
(
file
)
==
"."
+
consts
.
ExtNameJson
{
resultFile
=
file
return
resultFile
}
}
return
""
}
func
GetCasesFromChildren
(
scripts
[]
*
serverDomain
.
TestAsset
)
(
cases
[]
string
)
{
for
_
,
v
:=
range
scripts
{
if
v
.
Path
!=
""
{
cases
=
append
(
cases
,
v
.
Path
)
}
if
v
.
Children
!=
nil
{
GetCasesFromChildren
(
v
.
Children
)
}
}
return
}
internal/command/config/config.go
浏览文件 @
10d09544
...
...
@@ -10,8 +10,8 @@ import (
i118Utils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/i118"
logUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/log"
stdinUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/stdin"
configUtils
"github.com/aaronchen2k/deeptest/internal/server/modules/utils/config"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/repo"
configUtils
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/utils/config"
"github.com/fatih/color"
"os"
"reflect"
...
...
internal/server/modules/utils/exec/report-unit.go
浏览文件 @
10d09544
...
...
@@ -91,7 +91,11 @@ func GenUnitTestReport(req serverDomain.WsReq, startTime, endTime int64,
}
temp
:=
i118Utils
.
Sprintf
(
"found_scripts"
,
strconv
.
Itoa
(
len
(
cases
)))
+
postFix
sendExecMsg
(
temp
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
temp
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
temp
)
logUtils
.
ExecResult
(
temp
)
...
...
@@ -101,7 +105,11 @@ func GenUnitTestReport(req serverDomain.WsReq, startTime, endTime int64,
format
:=
"(%"
+
width
+
"d/%d) %s [%s] [%"
+
width
+
"d. %s] (%.3fs)"
msg
:=
fmt
.
Sprintf
(
format
,
idx
+
1
,
report
.
Total
,
cs
.
Status
,
testSuite
,
cs
.
Id
,
cs
.
Title
,
cs
.
Duration
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
temp
)
logUtils
.
ExecResult
(
msg
)
}
...
...
@@ -111,7 +119,10 @@ func GenUnitTestReport(req serverDomain.WsReq, startTime, endTime int64,
msg
+=
strings
.
Join
(
failedCaseLines
,
"
\n
"
)
msg
+=
strings
.
Join
(
failedCaseLinesDesc
,
"
\n
"
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
temp
)
logUtils
.
ExecResult
(
msg
)
}
...
...
@@ -142,14 +153,20 @@ func GenUnitTestReport(req serverDomain.WsReq, startTime, endTime int64,
report
.
Total
,
report
.
Duration
,
secTag
,
passStr
,
failStr
,
skipStr
,
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsole
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecResult
(
msg
)
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
)
}
logUtils
.
ExecConsole
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecResult
(
msg
)
...
...
internal/server/modules/utils/exec/report-ztf.go
浏览文件 @
10d09544
...
...
@@ -80,7 +80,10 @@ func GenZTFTestReport(report commDomain.ZtfReport, pathMaxWidth int,
msg
+=
strings
.
Join
(
failedCaseLines
,
"
\n
"
)
msg
+=
strings
.
Join
(
failedCaseLinesWithCheckpoint
,
"
\n
"
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgRed
,
msg
)
logUtils
.
ExecFile
(
msg
)
}
...
...
@@ -111,14 +114,21 @@ func GenZTFTestReport(report commDomain.ZtfReport, pathMaxWidth int,
report
.
Total
,
report
.
Duration
,
secTag
,
passStr
,
failStr
,
skipStr
,
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsole
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecResult
(
msg
)
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
)
}
logUtils
.
ExecConsole
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecResult
(
msg
)
...
...
internal/server/modules/utils/exec/result.go
浏览文件 @
10d09544
...
...
@@ -126,7 +126,10 @@ func ValidateCaseResult(scriptFile string, langType string,
status
:=
i118Utils
.
Sprintf
(
cs
.
Status
.
String
())
msg
:=
fmt
.
Sprintf
(
format
,
idx
+
1
,
total
,
status
,
path
,
cs
.
Id
,
cs
.
Title
,
secs
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsole
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecResult
(
msg
)
}
...
...
internal/server/modules/utils/exec/unit.go
浏览文件 @
10d09544
...
...
@@ -3,6 +3,7 @@ package scriptUtils
import
(
"bufio"
"errors"
commConsts
"github.com/aaronchen2k/deeptest/internal/comm/consts"
dateUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/date"
i118Utils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/i118"
logUtils
"github.com/aaronchen2k/deeptest/internal/pkg/lib/log"
...
...
@@ -21,7 +22,11 @@ func ExecUnit(ch chan int, sendOutputMsg,
startTime
:=
time
.
Now
()
startMsg
:=
i118Utils
.
Sprintf
(
"start_execution"
,
req
.
Cmd
,
dateUtils
.
DateTimeStr
(
startTime
))
sendExecMsg
(
startMsg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
startMsg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
-
1
,
startMsg
)
logUtils
.
ExecFilef
(
startMsg
)
...
...
@@ -29,7 +34,11 @@ func ExecUnit(ch chan int, sendOutputMsg,
entTime
:=
time
.
Now
()
endMsg
:=
i118Utils
.
Sprintf
(
"end_execution"
,
req
.
Cmd
,
dateUtils
.
DateTimeStr
(
entTime
))
sendExecMsg
(
endMsg
,
"false"
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
endMsg
,
"false"
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
-
1
,
endMsg
)
logUtils
.
ExecFilef
(
endMsg
)
...
...
@@ -95,7 +104,11 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st
select
{
case
<-
ch
:
msg
:=
i118Utils
.
Sprintf
(
"exit_exec_curr"
)
sendExecMsg
(
msg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
msg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecFilef
(
msg
)
...
...
internal/server/modules/utils/exec/ztf.go
浏览文件 @
10d09544
...
...
@@ -103,13 +103,19 @@ func ExeScripts(casesToRun []string, casesToIgnore []string, projectPath string,
}
temp
:=
i118Utils
.
Sprintf
(
"found_scripts"
,
strconv
.
Itoa
(
len
(
casesToRun
)))
+
postFix
sendExecMsg
(
temp
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
temp
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
temp
)
logUtils
.
ExecResult
(
temp
)
if
len
(
casesToIgnore
)
>
0
{
temp
:=
i118Utils
.
Sprintf
(
"ignore_scripts"
,
strconv
.
Itoa
(
len
(
casesToIgnore
)))
+
postFix
sendExecMsg
(
temp
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
temp
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
temp
)
logUtils
.
ExecResult
(
temp
)
}
...
...
@@ -120,6 +126,9 @@ func ExeScripts(casesToRun []string, casesToIgnore []string, projectPath string,
select
{
case
<-
ch
:
msg
:=
i118Utils
.
Sprintf
(
"exit_exec_all"
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
}
sendExecMsg
(
msg
,
""
,
wsMsg
)
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecFilef
(
msg
)
...
...
@@ -142,7 +151,10 @@ func ExeScript(scriptFile, projectPath string, conf commDomain.ProjectConf, repo
startTime
:=
time
.
Now
()
startMsg
:=
i118Utils
.
Sprintf
(
"start_execution"
,
scriptFile
,
dateUtils
.
DateTimeStr
(
startTime
))
sendExecMsg
(
startMsg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
startMsg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
-
1
,
startMsg
)
logUtils
.
ExecFilef
(
startMsg
)
...
...
@@ -163,7 +175,10 @@ func ExeScript(scriptFile, projectPath string, conf commDomain.ProjectConf, repo
secs
:=
fmt
.
Sprintf
(
"%.2f"
,
float32
(
entTime
.
Sub
(
startTime
)
/
time
.
Second
))
endMsg
:=
i118Utils
.
Sprintf
(
"end_execution"
,
scriptFile
,
dateUtils
.
DateTimeStr
(
entTime
))
sendExecMsg
(
endMsg
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendExecMsg
(
endMsg
,
""
,
wsMsg
)
}
logUtils
.
ExecConsolef
(
-
1
,
endMsg
)
logUtils
.
ExecFilef
(
endMsg
)
...
...
@@ -251,7 +266,9 @@ func RunScript(filePath, projectPath string, conf commDomain.ProjectConf,
for
{
line
,
err2
:=
reader1
.
ReadString
(
'\n'
)
if
line
!=
""
{
sendOutputMsg
(
line
,
""
,
wsMsg
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
sendOutputMsg
(
line
,
""
,
wsMsg
)
}
logUtils
.
ExecConsole
(
1
,
line
)
logUtils
.
ExecFile
(
line
)
...
...
@@ -266,6 +283,9 @@ func RunScript(filePath, projectPath string, conf commDomain.ProjectConf,
select
{
case
<-
ch
:
msg
:=
i118Utils
.
Sprintf
(
"exit_exec_curr"
)
if
commConsts
.
ComeFrom
!=
"cmd"
{
}
sendExecMsg
(
msg
,
""
,
wsMsg
)
logUtils
.
ExecConsolef
(
color
.
FgCyan
,
msg
)
logUtils
.
ExecFilef
(
msg
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录