mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 00:09:37 +08:00
change: do not send GA events in CI environment
This commit is contained in:
@@ -10,7 +10,7 @@ func TestSendEvents(t *testing.T) {
|
||||
Action: "SendEvents",
|
||||
Value: 123,
|
||||
}
|
||||
err := gaClient.SendEvent(event)
|
||||
err := SendEvent(event)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package sdk
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/denisbrodbeck/machineid"
|
||||
"github.com/getsentry/sentry-go"
|
||||
@@ -46,5 +47,9 @@ func init() {
|
||||
}
|
||||
|
||||
func SendEvent(e IEvent) error {
|
||||
if os.Getenv("CI") == "true" {
|
||||
// do not send GA events in CI environment
|
||||
return nil
|
||||
}
|
||||
return gaClient.SendEvent(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user