@@ -46,7 +46,7 @@ func newDefaultRunOption() *runOption {
46
46
}
47
47
}
48
48
49
- func newDiskCardRunOption () * runOption {
49
+ func newDiscardRunOption () * runOption {
50
50
return & runOption {
51
51
reporter : runner .NewDiscardTestReporter (),
52
52
reportWriter : runner .NewDiscardResultWriter (),
@@ -74,7 +74,7 @@ See also https://github.com/LinuxSuRen/api-testing/tree/master/sample`,
74
74
flags .DurationVarP (& opt .duration , "duration" , "" , 0 , "Running duration" )
75
75
flags .DurationVarP (& opt .requestTimeout , "request-timeout" , "" , time .Minute , "Timeout for per request" )
76
76
flags .BoolVarP (& opt .requestIgnoreError , "request-ignore-error" , "" , false , "Indicate if ignore the request error" )
77
- flags .StringVarP (& opt .report , "report" , "" , "" , "The type of target report. Supported: markdown, md, discard, std" )
77
+ flags .StringVarP (& opt .report , "report" , "" , "" , "The type of target report. Supported: markdown, md, html, discard, std" )
78
78
flags .StringVarP (& opt .reportFile , "report-file" , "" , "" , "The file path of the report" )
79
79
flags .BoolVarP (& opt .reportIgnore , "report-ignore" , "" , false , "Indicate if ignore the report output" )
80
80
flags .Int64VarP (& opt .thread , "thread" , "" , 1 , "Threads of the execution" )
@@ -98,6 +98,8 @@ func (o *runOption) preRunE(cmd *cobra.Command, args []string) (err error) {
98
98
switch o .report {
99
99
case "markdown" , "md" :
100
100
o .reportWriter = runner .NewMarkdownResultWriter (writer )
101
+ case "html" :
102
+ o .reportWriter = runner .NewHTMLResultWriter (writer )
101
103
case "discard" :
102
104
o .reportWriter = runner .NewDiscardResultWriter ()
103
105
case "" , "std" :
@@ -178,7 +180,7 @@ func (o *runOption) runSuiteWithDuration(suite string) (err error) {
178
180
defer sem .Release (1 )
179
181
defer wait .Done ()
180
182
defer func () {
181
- fmt .Println ("routing end with" , time .Now (). Sub (now ))
183
+ fmt .Println ("routing end with" , time .Since (now ))
182
184
}()
183
185
184
186
dataContext := getDefaultContext ()
0 commit comments