Add Sentry Spans for Bash execution.

This commit is contained in:
Maximilian Paß
2023-02-17 13:25:12 +00:00
committed by Sebastian Serth
parent 526e938985
commit cc0c425197
4 changed files with 144 additions and 9 deletions

View File

@ -0,0 +1,21 @@
package nomad
import (
"bytes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
func TestSentryDebugWriter_Write(t *testing.T) {
buf := &bytes.Buffer{}
w := SentryDebugWriter{Target: buf}
description := "TestDebugMessageDescription"
data := "\x1EPoseidon " + description + " 1676646791482\x1E"
count, err := w.Write([]byte(data))
require.NoError(t, err)
assert.Equal(t, len(data), count)
assert.NotContains(t, buf.String(), description)
}