mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: provisionerd tracing, add public trace ingestion (#4070)
This commit is contained in:
39
coderd/tracing/util_test.go
Normal file
39
coderd/tracing/util_test.go
Normal file
@ -0,0 +1,39 @@
|
||||
package tracing_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/coder/coder/coderd/tracing"
|
||||
)
|
||||
|
||||
// t.Parallel affects the result of these tests.
|
||||
|
||||
//nolint:paralleltest
|
||||
func TestFuncName(t *testing.T) {
|
||||
fn := tracing.FuncName()
|
||||
assert.Equal(t, "tracing_test.TestFuncName", fn)
|
||||
}
|
||||
|
||||
type foo struct{}
|
||||
|
||||
func (foo) bar() string {
|
||||
return tracing.FuncName()
|
||||
}
|
||||
|
||||
//nolint:paralleltest
|
||||
func TestFuncNameMethod(t *testing.T) {
|
||||
fn := foo{}.bar()
|
||||
assert.Equal(t, "tracing_test.foo.bar", fn)
|
||||
}
|
||||
|
||||
func (*foo) baz() string {
|
||||
return tracing.FuncName()
|
||||
}
|
||||
|
||||
//nolint:paralleltest
|
||||
func TestFuncNameMethodPointer(t *testing.T) {
|
||||
fn := (&foo{}).baz()
|
||||
assert.Equal(t, "tracing_test.(*foo).baz", fn)
|
||||
}
|
Reference in New Issue
Block a user