marshal_test.go 425 B

123456789101112131415161718
  1. package trace
  2. import (
  3. "testing"
  4. )
  5. func TestMarshalSpanV1(t *testing.T) {
  6. report := &mockReport{}
  7. t1 := newTracer("service1", report, &Config{DisableSample: true})
  8. sp1 := t1.New("opt_test").(*span)
  9. sp1.SetLog(Log("hello", "test123"))
  10. sp1.SetTag(TagString("tag1", "hell"), TagBool("booltag", true), TagFloat64("float64tag", 3.14159))
  11. sp1.Finish(nil)
  12. _, err := marshalSpanV1(sp1)
  13. if err != nil {
  14. t.Error(err)
  15. }
  16. }