提交 7a98679e 编写于 作者: Z zhaoke

Merge branch 'main' of git.zcorp.cc:pangu/zentaoatf

......@@ -11,8 +11,9 @@ const (
Ip = "127.0.0.1"
Port = 8085
JobTimeoutTime = 60 * 30
JobRetryTime = 3
LevelToScanScriptFile = 8
JobTimeoutTime = 60 * 30
JobRetryTime = 3
ConfigVersion = "3.0"
ConfigDir = "conf"
......
......@@ -2,7 +2,6 @@ package execHelper
import (
"path"
"path/filepath"
"strconv"
"time"
......@@ -26,31 +25,24 @@ import (
)
func ExecCases(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (report commDomain.ZtfReport, pathMaxWidth int, err error) {
// if testSet.Cmd != "" {
// err = execCmd(testSet.Cmd, testSet.WorkspacePath)
// if err != nil {
// return
// }
// }
return RunZtf(ch, testSet.WorkspacePath, 0, 0, commConsts.Case, testSet.Cases, msg)
}
func execCmd(cmd string, workspacePath string) (err error) {
pth := filepath.Join(workspacePath, ".cmd.tmp")
fileUtils.WriteFile(pth, cmd)
conf := configHelper.LoadByWorkspacePath(workspacePath)
stdOutput, errOutput := RunFile(pth, workspacePath, conf, nil, nil)
if errOutput != "" {
logUtils.Infof("failed to exec command '%s' without output %s, err %v.", pth, stdOutput, errOutput)
} else {
logUtils.Infof("exec command '%s' with output %v.", pth, stdOutput)
}
return
}
//func execCmd(cmd string, workspacePath string) (err error) {
// pth := filepath.Join(workspacePath, ".cmd.tmp")
// fileUtils.WriteFile(pth, cmd)
//
// conf := configHelper.LoadByWorkspacePath(workspacePath)
//
// stdOutput, errOutput := RunFile(pth, workspacePath, conf, nil, nil)
// if errOutput != "" {
// logUtils.Infof("failed to exec command '%s' without output %s, err %v.", pth, stdOutput, errOutput)
// } else {
// logUtils.Infof("exec command '%s' with output %v.", pth, stdOutput)
// }
//
// return
//}
func ExecModule(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (
report commDomain.ZtfReport, pathMaxWidth int, err error) {
......
......@@ -138,7 +138,7 @@ func LoadScriptListInDir(path string, files *[]string, level int) error {
continue
}
if fi.IsDir() && level < 3 { // 目录, 递归遍历
if fi.IsDir() && level < commConsts.LevelToScanScriptFile { // 目录, 递归遍历
LoadScriptListInDir(path+name+consts.FilePthSep, files, level+1)
continue
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册