Skip to content

Commit

Permalink
autotest step concurrency interface display (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey authored Nov 10, 2021
1 parent 39ebe61 commit 6593ecd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ func getProps() map[string]interface{} {
Width: 85,
Ellipsis: true,
},
{
Title: "步骤",
DataIndex: "step",
Width: 85,
Ellipsis: true,
},
{
Title: "子任务数",
DataIndex: "tasksNum",
Expand Down Expand Up @@ -291,6 +297,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
num := (a.State.PageNo - 1) * (a.State.PageSize)
ret := a.State.PageSize
a.State.Total = 0
stepIdx := 1
for _, each := range pipeline.PipelineStages {
a.State.Total += int64(len(each.PipelineTasks))
if ret == 0 {
Expand Down Expand Up @@ -425,6 +432,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
"type": transformStepType(res.Type),
"path": path,
"time": a.getCostTime(task),
"step": stepIdx,
}

if task.SnippetPipelineID != nil && (res.Type == apistructs.StepTypeScene ||
Expand Down Expand Up @@ -460,6 +468,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
"type": transformStepType(apistructs.AutotestSceneSet),
"path": "",
"time": a.getCostTime(task),
"step": stepIdx,
}
if task.SnippetPipelineDetail != nil {
list["tasksNum"] = task.SnippetPipelineDetail.DirectSnippetTasksNum
Expand Down Expand Up @@ -493,6 +502,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
"type": transformStepType(apistructs.AutotestScene),
"path": "",
"time": a.getCostTime(task),
"step": stepIdx,
}
if task.SnippetPipelineDetail != nil {
list["tasksNum"] = task.SnippetPipelineDetail.DirectSnippetTasksNum
Expand All @@ -507,6 +517,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
break
}
}
stepIdx++
}
if a.State.Total <= (a.State.PageNo-1)*(a.State.PageSize) && a.State.Total > 0 {
a.State.PageNo = DefaultPageNo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ func getProps() map[string]interface{} {
Width: 85,
Ellipsis: true,
},
{
Title: "步骤",
DataIndex: "step",
Width: 85,
Ellipsis: true,
},
{
Title: "子任务数",
DataIndex: "tasksNum",
Expand Down Expand Up @@ -282,7 +288,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
num := (a.State.PageNo - 1) * (a.State.PageSize)
ret := a.State.PageSize
a.State.Total = 0

stepIdx := 1
for _, each := range pipeline.PipelineStages {

a.State.Total += int64(len(each.PipelineTasks))
Expand Down Expand Up @@ -352,6 +358,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
"status": getStatus(task.Status),
"type": transformStepType(apistructs.StepAPIType(task.Type)),
"path": "",
"step": stepIdx,
}
} else {
// autotest task
Expand Down Expand Up @@ -429,6 +436,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
"status": getStatus(task.Status),
"type": transformStepType(res.Type),
"path": path,
"step": stepIdx,
}

// scene or configSheet add other info
Expand All @@ -448,6 +456,7 @@ func (a *ExecuteTaskTable) setData(pipeline *apistructs.PipelineDetailDTO) error
break
}
}
stepIdx++
}

if a.State.Total <= (a.State.PageNo-1)*(a.State.PageSize) && a.State.Total > 0 {
Expand Down

0 comments on commit 6593ecd

Please sign in to comment.