Skip to content

Commit

Permalink
fix test report link
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zhao <[email protected]>
  • Loading branch information
PetrusZ committed Feb 13, 2025
1 parent b89d65d commit 211dca9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type CustomWorkflowTestReport struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
WorkflowName string `bson:"workflow_name"`
JobName string `bson:"job_name"`
JobTaskName string `bson:"job_task_name"`
TaskID int64 `bson:"task_id"`
ServiceName string `bson:"service_name"`
ServiceModule string `bson:"service_module"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ type JobPreview struct {
}

type WorkflowTestModule struct {
RunningJobName string `json:"running_job_name"`
JobTaskName string `json:"job_task_name"`
Type string `json:"type"`
TestName string `json:"name"`
TestCaseNum int `json:"total_case_num"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (s *junitReportCtl) AfterRun(ctx context.Context) error {
err = commonrepo.NewCustomWorkflowTestReportColl().Create(&commonmodels.CustomWorkflowTestReport{
WorkflowName: s.junitReportSpec.SourceWorkflow,
JobName: s.junitReportSpec.SourceJobKey,
JobTaskName: s.junitReportSpec.JobTaskName,
TaskID: s.junitReportSpec.TaskID,
ServiceName: s.junitReportSpec.ServiceName,
ServiceModule: s.junitReportSpec.ServiceModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ func (j *TestingJob) toJobtask(jobSubTaskID int, testing *commonmodels.TestModul
Spec: &step.StepJunitReportSpec{
SourceWorkflow: j.workflow.Name,
SourceJobKey: j.job.Name,
JobTaskName: jobName,
TaskID: taskID,
ReportDir: testingInfo.TestResultPath,
S3DestDir: path.Join(j.workflow.Name, fmt.Sprint(taskID), jobTask.Name, "junit"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ func ListWorkflowTaskV4ByFilter(filter *TaskHistoryFilter, filterList []string,

for _, testResult := range testResultList {
testModules = append(testModules, &commonmodels.WorkflowTestModule{
RunningJobName: job.Name,
JobTaskName: testResult.JobTaskName,
Type: "function",
TestName: testResult.ZadigTestName,
TestCaseNum: testResult.TestCaseNum,
Expand Down
1 change: 1 addition & 0 deletions pkg/types/step/step_junit_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type StepJunitReportSpec struct {
SourceWorkflow string `bson:"source_workflow" json:"source_workflow" yaml:"source_workflow"`
// no stage name is recorded since the job name is unique, for now (version 2.1.0)
SourceJobKey string `bson:"source_job_key" json:"source_job_key" yaml:"source_job_key"`
JobTaskName string `bson:"job_task_name" json:"job_task_name" yaml:"job_task_name"`
TaskID int64 `bson:"task_id" json:"task_id" yaml:"task_id"`
ServiceName string `bson:"service_name" json:"service_name" yaml:"service_name"`
ServiceModule string `bson:"service_module" json:"service_module" yaml:"service_module"`
Expand Down

0 comments on commit 211dca9

Please sign in to comment.