Skip to content

Commit

Permalink
Merge pull request #16 from vearne/develop
Browse files Browse the repository at this point in the history
fix report bug
  • Loading branch information
vearne authored Jun 6, 2024
2 parents d28ecaa + f73444b commit 1b7a27f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions internal/command/http_automate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package command

import (
"context"
"fmt"
"github.com/lianggaoqiang/progress"
"github.com/vearne/autotest/internal/config"
"github.com/vearne/autotest/internal/model"
Expand Down Expand Up @@ -72,7 +71,6 @@ func GenReportFileHttp(testCasefilePath string, tcResultList []HttpTestCaseResul
})
var records [][]string
records = append(records, []string{"id", "desc", "state", "reason"})
fmt.Println("-------", len(tcResultList))
for _, item := range tcResultList {
reasonStr := item.Reason.String()
if item.Reason == model.ReasonSuccess {
Expand Down
2 changes: 1 addition & 1 deletion internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func WriterCSV(path string, records [][]string) {
File, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0666)
File, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
if err != nil {
slog.Error("file open failed:%v", err)
return
Expand Down

0 comments on commit 1b7a27f

Please sign in to comment.