fix: report transaction result

This commit is contained in:
debugtalk
2021-12-21 20:38:36 +08:00
parent e7ecd148d0
commit f11310a8bd
10 changed files with 85 additions and 51 deletions

View File

@@ -20,7 +20,7 @@ var runCmd = &cobra.Command{
for _, arg := range args {
paths = append(paths, &hrp.TestCasePath{Path: arg})
}
runner := hrp.NewRunner(nil).SetDebug(!silentFlag)
runner := hrp.NewRunner(nil).SetDebug(!silentFlag).SetFailfast(!continueOnFailure)
if proxyUrl != "" {
runner.SetProxyUrl(proxyUrl)
}
@@ -29,12 +29,14 @@ var runCmd = &cobra.Command{
}
var (
silentFlag bool
proxyUrl string
continueOnFailure bool
silentFlag bool
proxyUrl string
)
func init() {
RootCmd.AddCommand(runCmd)
runCmd.Flags().BoolVar(&continueOnFailure, "continue-on-failure", false, "continue running next step when failure occurs")
runCmd.Flags().BoolVarP(&silentFlag, "silent", "s", false, "disable logging request & response details")
runCmd.Flags().StringVarP(&proxyUrl, "proxy-url", "p", "", "set proxy url")
// runCmd.Flags().BoolP("gen-html-report", "r", false, "Generate HTML report")