mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 14:29:44 +08:00
fix: typo
change: do not add console output by default feat: add GA for docs refactor: move builtin to internal refactor: relocate sentry sdk feat: report events with ga change: use http client session fix: report GA events change: sentry
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/httprunner/hrp"
|
||||
"github.com/httprunner/hrp/internal/ga"
|
||||
)
|
||||
|
||||
var log = hrp.GetLogger()
|
||||
@@ -41,6 +42,15 @@ func (h *HAR) SetOutputDir(dir string) {
|
||||
}
|
||||
|
||||
func (h *HAR) GenJSON() (jsonPath string, err error) {
|
||||
event := ga.EventTracking{
|
||||
Category: "har2case",
|
||||
Action: "hrp har2case --to-json",
|
||||
}
|
||||
// report start event
|
||||
go ga.SendEvent(event)
|
||||
// report running timing event
|
||||
defer ga.SendEvent(event.StartTiming("execution"))
|
||||
|
||||
tCase, err := h.makeTestCase()
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -51,6 +61,15 @@ func (h *HAR) GenJSON() (jsonPath string, err error) {
|
||||
}
|
||||
|
||||
func (h *HAR) GenYAML() (yamlPath string, err error) {
|
||||
event := ga.EventTracking{
|
||||
Category: "har2case",
|
||||
Action: "hrp har2case --to-yaml",
|
||||
}
|
||||
// report start event
|
||||
go ga.SendEvent(event)
|
||||
// report running timing event
|
||||
defer ga.SendEvent(event.StartTiming("execution"))
|
||||
|
||||
tCase, err := h.makeTestCase()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user