Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions router-tests/telemetry/attribute_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"strings"
"testing"
"time"

"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testenv"
Expand Down Expand Up @@ -189,25 +188,17 @@ func TestAttributeProcessorIntegration(t *testing.T) {
})

t.Run("invalid UTF-8 export error logs config hint", func(t *testing.T) {
t.Parallel()

testenv.Run(t, &testenv.Config{
TraceExporter: &invalidUTF8Exporter{},
LogObservation: testenv.LogObservationConfig{
Enabled: true,
LogLevel: zapcore.ErrorLevel,
},
}, func(t *testing.T, xEnv *testenv.Environment) {
require.Eventually(t, func() bool {
res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{
Query: `query { employees { id } }`,
})
if res.Response.StatusCode != 200 {
return false
}
logs := xEnv.Observer().FilterMessageSnippet("sanitize_utf8").All()
return len(logs) > 0
}, 10*time.Second, 500*time.Millisecond)
res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{
Query: `query { employees { id } }`,
})
require.Equal(t, 200, res.Response.StatusCode)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

logs := xEnv.Observer().FilterMessageSnippet("sanitize_utf8").All()
require.NotEmpty(t, logs)
Expand Down
Loading