gitee.com/woood2/luca@v1.0.4/internal/repository/app_test.go (about) 1 package repository 2 3 import ( 4 "context" 5 "gitee.com/woood2/luca/internal/trace" 6 "gitee.com/woood2/luca/internal/util" 7 "github.com/openzipkin/zipkin-go" 8 "testing" 9 ) 10 11 func TestGetApp(t *testing.T) { 12 util.SkipCI(t) 13 var tests = []struct { 14 appkey string 15 }{ 16 {"weibo2"}, 17 {"weibo3"}, 18 } 19 for _, tt := range tests { 20 span := trace.StartSpan("test-get-app") 21 ctx := zipkin.NewContext(context.Background(), span) 22 if app, err := appRepo.GetByKey(ctx, tt.appkey); err != nil { 23 t.Errorf("expected err=nil; actual app=%v, err=%v", app, err) 24 } 25 span.Finish() 26 } 27 }