提交 ac50e424 编写于 作者: 雨爱无痕

Fix issue.

上级 bb5f1476
......@@ -245,6 +245,7 @@ type UnitResult struct {
ErrorContent string `json:"errorContent" xml:"error,omitempty"`
Id int `json:"id"`
Cid int `json:"cid"`
Status commConsts.ResultStatus `json:"status"`
}
type CaseSlice []UnitResult
......
......@@ -420,6 +420,7 @@ func ConvertAllureResult(cases []commDomain.AllureCase) (testSuites []commDomain
}
caseResult := commDomain.UnitResult{
Id: caseId,
Cid: caseId,
Title: cs.Name,
TestSuite: suiteName,
Duration: float32(cs.Stop-cs.Start) / 1000,
......
......@@ -146,7 +146,7 @@ func isStepLine(line string) (is bool, ret string, isChild bool) {
is = true
ret = arr[2]
if len(arr[1]) > 0 {
if len(arr[1]) > 1 {
isChild = true
}
}
......@@ -327,10 +327,7 @@ func getSortedTextFromNestedSteps(groups []commDomain.ZtfStep) (ret string, step
for _, group := range groups {
step := commDomain.ZentaoCaseStep{}
stepType := commConsts.Item
if len(group.Children) > 0 {
stepType = commConsts.Group
}
stepType := commConsts.Group
step.Type = stepType
stepTxt := strings.TrimSpace(group.Desc)
......@@ -448,7 +445,7 @@ func GetCaseInfo(file string) (pass bool, caseId, productId int, title string, t
if isOldFormat {
regStr = `(?s)\[case\](.*)\[esac\]`
} else {
regStr = fmt.Sprintf(`(?sm)%s((?U:.*pid.*))\n(.*)%s`,
regStr = fmt.Sprintf(`(?sm)%s((?U:.*cid.*))\n(.*)%s`,
commConsts.LangCommentsRegxMap[lang][0], commConsts.LangCommentsRegxMap[lang][1])
}
myExp := regexp.MustCompile(regStr)
......@@ -471,7 +468,7 @@ func GetCaseInfo(file string) (pass bool, caseId, productId int, title string, t
timeout, _ = strconv.ParseInt(arr[1], 10, 64)
}
myExp = regexp.MustCompile(`[\S\s]*pid=\s*([^\n]*?)\s*\n`)
myExp = regexp.MustCompile(`[\S\s]*cid=\s*([^\n]*?)\s*\n`)
arr = myExp.FindStringSubmatch(caseInfo)
if len(arr) > 1 {
productId, _ = strconv.Atoi(arr[1])
......
......@@ -84,16 +84,8 @@ func RemoveAutoCreateId(report *commDomain.ZtfReport) {
if report.TestType == commConsts.TestFunc {
return
}
isAuto := true
for idx, cs := range report.UnitResult {
if cs.Id != idx+1 {
isAuto = false
}
}
if isAuto {
for idx, _ := range report.UnitResult {
report.UnitResult[idx].Id = 0
}
report.UnitResult[idx].Id = cs.Cid
}
return
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册