Skip to content

Commit

Permalink
chore(echo): rename GetTransaction to GetSpan (#812)
Browse files Browse the repository at this point in the history
Co-authored-by: Michi Hoffmann <cleptric@users.noreply.github.com>
  • Loading branch information
aldy505 and cleptric committed Apr 8, 2024
1 parent a6a7a20 commit 9311a06
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions echo/sentryecho_test.go
Expand Up @@ -413,7 +413,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 @@ -423,17 +423,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 @@ -447,10 +447,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 9311a06

Please sign in to comment.