refactor: config results path

This commit is contained in:
lilong.129
2025-06-15 22:55:02 +08:00
parent c62913ba1a
commit a78ba90d33
7 changed files with 113 additions and 38 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/spf13/cobra"
hrp "github.com/httprunner/httprunner/v5"
"github.com/httprunner/httprunner/v5/internal/config"
)
var CmdReport = &cobra.Command{
@@ -24,9 +25,9 @@ Examples:
resultFolder := args[0]
// Construct file paths
summaryFile := filepath.Join(resultFolder, "summary.json")
logFile := filepath.Join(resultFolder, "hrp.log")
reportFile := filepath.Join(resultFolder, "report.html")
summaryFile := filepath.Join(resultFolder, config.SummaryFileName)
logFile := filepath.Join(resultFolder, config.LogFileName)
reportFile := filepath.Join(resultFolder, config.ReportFileName)
// Generate HTML report
if err := hrp.GenerateHTMLReportFromFiles(summaryFile, logFile, reportFile); err != nil {