refactor: results dir

This commit is contained in:
debugtalk
2022-12-16 00:24:35 +08:00
parent ee68b954fb
commit 455724dd1b
12 changed files with 24 additions and 26 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ func newOutSummary() *Summary {
Success: true,
Stat: &Stat{},
Time: &TestCaseTime{
StartAt: time.Now(),
StartAt: env.StartTime,
},
Platform: platForm,
}
@@ -73,7 +73,7 @@ func (s *Summary) genHTMLReport() error {
return err
}
reportPath := filepath.Join(reportsDir, fmt.Sprintf("report-%v.html", s.Time.StartAt.Unix()))
reportPath := filepath.Join(reportsDir, "report.html")
file, err := os.OpenFile(reportPath, os.O_WRONLY|os.O_CREATE, 0o666)
if err != nil {
log.Error().Err(err).Msg("open file failed")
@@ -103,7 +103,7 @@ func (s *Summary) genSummary() error {
return err
}
summaryPath := filepath.Join(reportsDir, fmt.Sprintf("summary-%v.json", s.Time.StartAt.Unix()))
summaryPath := filepath.Join(reportsDir, "summary.json")
err = builtin.Dump2JSON(s, summaryPath)
if err != nil {
return err