Skip to content

Commit

Permalink
Merge branch 'master' into normalize-http-status-code
Browse files Browse the repository at this point in the history
  • Loading branch information
ribice committed Apr 8, 2024
2 parents 6612d85 + 9311a06 commit 96cb304
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions echo/sentryecho_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func TestIntegration(t *testing.T) {
}
}

func TestGetTransactionFromContext(t *testing.T) {
func TestGetSpanFromContext(t *testing.T) {
err := sentry.Init(sentry.ClientOptions{
EnableTracing: true,
TracesSampleRate: 1.0,
Expand All @@ -430,17 +430,17 @@ func TestGetTransactionFromContext(t *testing.T) {
}

router := echo.New()
router.GET("/no-transaction", func(c echo.Context) error {
transaction := sentryecho.GetSpanFromContext(c)
if transaction != nil {
t.Error("expecting transaction to be nil")
router.GET("/no-span", func(c echo.Context) error {
span := sentryecho.GetSpanFromContext(c)
if span != nil {
t.Error("expecting span to be nil")
}
return c.NoContent(http.StatusOK)
})
router.GET("/with-transaction", func(c echo.Context) error {
transaction := sentryecho.GetSpanFromContext(c)
if transaction == nil {
t.Error("expecting transaction to be not nil")
router.GET("/with-span", func(c echo.Context) error {
span := sentryecho.GetSpanFromContext(c)
if span == nil {
t.Error("expecting span to not be nil")
}
return c.NoContent(http.StatusOK)
}, sentryecho.New(sentryecho.Options{}))
Expand All @@ -454,10 +454,10 @@ func TestGetTransactionFromContext(t *testing.T) {
RequestPath string
}{
{
RequestPath: "/no-transaction",
RequestPath: "/no-span",
},
{
RequestPath: "/with-transaction",
RequestPath: "/with-span",
},
}
c.Timeout = time.Second
Expand Down

0 comments on commit 96cb304

Please sign in to comment.