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:
debugtalk
2021-11-22 16:23:47 +08:00
parent ae7710e9d0
commit 7fd26395ed
30 changed files with 286 additions and 42 deletions

View File

@@ -3,7 +3,7 @@ package cmd
import (
"time"
"github.com/getsentry/sentry-go"
"github.com/myzhan/boomer"
"github.com/spf13/cobra"
"github.com/httprunner/hrp"
@@ -19,15 +19,15 @@ var boomCmd = &cobra.Command{
$ hrp boom examples/ # run testcases in specified folder`,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
sentry.CaptureMessage("start to run load test")
var paths []hrp.ITestCase
for _, arg := range args {
paths = append(paths, &hrp.TestCasePath{Path: arg})
}
boomer := hrp.NewStandaloneBoomer(spawnCount, spawnRate)
boomer.EnableCPUProfile(cpuProfile, cpuProfileDuration)
boomer.EnableMemoryProfile(memoryProfile, memoryProfileDuration)
boomer.Run(paths...)
hrpBoomer := hrp.NewStandaloneBoomer(spawnCount, spawnRate)
hrpBoomer.AddOutput(boomer.NewConsoleOutput())
hrpBoomer.EnableCPUProfile(cpuProfile, cpuProfileDuration)
hrpBoomer.EnableMemoryProfile(memoryProfile, memoryProfileDuration)
hrpBoomer.Run(paths...)
},
}

View File

@@ -1,7 +1,6 @@
package cmd
import (
"github.com/getsentry/sentry-go"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
@@ -15,7 +14,6 @@ var har2caseCmd = &cobra.Command{
Long: `Convert HAR to json/yaml testcase files`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
sentry.CaptureMessage("start to convert HAR to testcases")
var outputFiles []string
for _, arg := range args {
var outputPath string

View File

@@ -7,6 +7,7 @@ import (
"github.com/spf13/cobra"
"github.com/httprunner/hrp"
"github.com/httprunner/hrp/internal/version"
)
// RootCmd represents the base command when called without any subcommands
@@ -24,7 +25,7 @@ Copyright 2021 debugtalk`,
}
hrp.SetLogLevel(logLevel)
},
Version: hrp.VERSION,
Version: version.VERSION,
}
var (

View File

@@ -1,7 +1,6 @@
package cmd
import (
"github.com/getsentry/sentry-go"
"github.com/spf13/cobra"
"github.com/httprunner/hrp"
@@ -17,7 +16,6 @@ var runCmd = &cobra.Command{
$ hrp run examples/ # run testcases in specified folder`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
sentry.CaptureMessage("start to run API tests")
var paths []hrp.ITestCase
for _, arg := range args {
paths = append(paths, &hrp.TestCasePath{Path: arg})