提交 6dce10bd 编写于 作者: Z zhaoke

Merge branch 'morden-ui' of github.com:easysoft/zentaoatf into morden-ui

......@@ -22,10 +22,11 @@ var (
independentFile bool
keywords string
productId string
moduleId string
taskId string
suiteId string
productId string
moduleId string
taskIdOrName string
suiteId string
taskName string
noNeedConfirm bool
......@@ -52,8 +53,8 @@ func main() {
flagSet.StringVar(&suiteId, "s", "", "")
flagSet.StringVar(&suiteId, "suite", "", "")
flagSet.StringVar(&taskId, "t", "", "")
flagSet.StringVar(&taskId, "task", "", "")
flagSet.StringVar(&taskIdOrName, "t", "", "")
flagSet.StringVar(&taskIdOrName, "task", "", "")
flagSet.StringVar(&language, "l", "", "")
flagSet.StringVar(&language, "language", "", "")
......@@ -96,7 +97,7 @@ func main() {
case "checkout", "co":
if err := flagSet.Parse(os.Args[2:]); err == nil {
action.Checkout(productId, moduleId, suiteId, taskId, independentFile, language)
action.Checkout(productId, moduleId, suiteId, taskIdOrName, independentFile, language)
}
case "ci":
......@@ -108,8 +109,8 @@ func main() {
case "cr":
files := fileUtils.GetFilesFromParams(os.Args[2:])
if err := flagSet.Parse(os.Args[len(files)+2:]); err == nil {
action.CommitZTFTestResult(files, stringUtils.ParseInt(productId), stringUtils.ParseInt(taskId),
noNeedConfirm)
action.CommitZTFTestResult(files, stringUtils.ParseInt(productId),
taskIdOrName, noNeedConfirm)
}
case "cb":
......@@ -166,7 +167,7 @@ func run(args []string) {
if commConsts.AutoCommitResult && productId != "" {
action.CommitZTFTestResult([]string{commConsts.ExecLogDir},
stringUtils.ParseInt(productId), stringUtils.ParseInt(productId), true)
stringUtils.ParseInt(productId), taskIdOrName, true)
}
if commConsts.AutoCommitBug && productId != "" {
......@@ -198,7 +199,7 @@ func runFuncTest(args []string) {
msgStr := i118Utils.Sprintf("run_with_specific_interpreter", commConsts.Interpreter)
logUtils.ExecConsolef(color.FgCyan, msgStr)
}
action.RunZTFTest(files, moduleId, suiteId, taskId)
action.RunZTFTest(files, moduleId, suiteId, taskIdOrName)
}
func runUnitTest(args []string) {
......
......@@ -12,7 +12,7 @@ import (
"strconv"
)
func CommitZTFTestResult(files []string, productId, taskId int, noNeedConfirm bool) {
func CommitZTFTestResult(files []string, productId int, taskIdOrName string, noNeedConfirm bool) {
var resultDir string
if len(files) > 0 {
resultDir = files[0]
......@@ -26,6 +26,12 @@ func CommitZTFTestResult(files []string, productId, taskId int, noNeedConfirm bo
productId, _ = strconv.Atoi(productIdStr)
}
taskName := ""
taskId, err := strconv.Atoi(taskIdOrName)
if err != nil {
taskName = taskIdOrName
}
if taskId == 0 && !noNeedConfirm {
taskIdStr := stdinUtils.GetInput("\\d*", "",
i118Utils.Sprintf("pls_enter")+" "+i118Utils.Sprintf("task_id")+
......@@ -36,6 +42,7 @@ func CommitZTFTestResult(files []string, productId, taskId int, noNeedConfirm bo
result := serverDomain.ZentaoResultSubmitReq{
ProductId: productId,
TaskId: taskId,
Name: taskName,
Seq: resultDir,
}
......
......@@ -146,6 +146,8 @@ type ZentaoBug struct {
}
type ZtfReport struct {
Name string `json:"name"`
TestEnv commConsts.OsType `json:"testEnv,omitempty"`
TestType commConsts.TestType `json:"testType"`
TestTool commConsts.TestTool `json:"testTool"`
......
......@@ -43,6 +43,7 @@ func GenUnitTestReport(req serverDomain.TestSet, startTime, endTime int64,
}
report = commDomain.ZtfReport{
Name: req.Name,
TestEnv: commonUtils.GetOs(),
TestType: commConsts.TestUnit,
TestTool: req.TestTool,
......
......@@ -26,6 +26,8 @@ type WsReq struct {
}
type TestSet struct {
Name string `json:"name"`
WorkspaceId int `json:"workspaceId"`
WorkspaceType commConsts.TestTool `json:"workspaceType"`
WorkspacePath string `json:"workspacePath"`
......
......@@ -10,7 +10,7 @@ type ZentaoRespData struct {
}
type ZentaoResultSubmitReq struct {
Title string `json:"title"`
Name string `json:"name"`
Seq string `json:"seq"`
WorkspaceId int `json:"workspaceId"`
ProductId int `json:"productId"`
......
......@@ -150,6 +150,7 @@ func (s *TestResultService) Submit(result serverDomain.ZentaoResultSubmitReq, si
}
config := configHelper.LoadBySite(site)
report.Name = result.Name
err = zentaoHelper.CommitResult(report, result.ProductId, result.TaskId, config, nil)
return
......
......@@ -226,6 +226,8 @@ export default {
'pls_select_task': 'Please select task',
'or_input_task_name': 'Or input new task name',
'task_name': 'Zentao Task Name',
'pls_select_workspace': 'Please select workspace.',
'pls_add_zentao_site': 'Please add zentao site.',
'pls_create_workspace': 'Please create workspace to continue.',
......
......@@ -237,6 +237,7 @@ export default {
'pls_select_task': '请选择任务',
'or_input_task_name': '或输入新任务标题',
'task_name': '禅道任务标题',
'pls_select_workspace': '请选择导出到的工作目录。',
'pls_add_zentao_site': '初次使用,请点击右上按钮新建禅道站点。',
......
......@@ -168,7 +168,7 @@ const exec = (data: any) => {
msg = {act: 'execCase', testSets: sets}
} else if (execType === 'unit') {
const set = {workspaceId: data.id, workspaceType: data.type, cmd: data.cmd, submitResult: data.submitResult}
const set = {workspaceId: data.id, workspaceType: data.type, cmd: data.cmd, submitResult: data.submitResult, name: data.name}
msg = {act: 'execUnit', testSets: [set]}
......
......@@ -9,6 +9,10 @@
<input v-model="modelRef.submitResult" type="checkbox">
</FormItem>
<FormItem labelWidth="100px" v-if="modelRef.submitResult" name="name" :label="t('task_name')">
<input v-model="modelRef.name">
</FormItem>
<FormItem labelWidth="100px">
<Button :disabled="isRunning === 'true' || !modelRef.cmd" @click="start" class="rounded primary">
{{ t('exec') }}
......
......@@ -18,8 +18,8 @@
</div>
</FormItem>
<FormItem v-if="!modelRef.taskId" name="title" :label="t('or_input_task_name')" labelWidth="120px">
<input type="text" v-model="modelRef.title" />
<FormItem v-if="!modelRef.taskId" name="name" :label="t('or_input_task_name')" labelWidth="120px">
<input type="text" v-model="modelRef.name" />
</FormItem>
</Form>
</ZModal>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册