mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-09 17:59:36 +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:
@@ -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...)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user