Skip to content

tracingTest helper needs to be redone with OTel #8853

@simkam

Description

@simkam

// TODO - redo with OTel
// Start the event info store. Note this is done _before_ we setup the infrastructure, which
// sends the event.
// targetTracker, err := recordevents.NewEventInfoStore(client, recordEventsPodName, client.Namespace)
// if err != nil {
// t.Fatal("Pod tracker failed:", err)
// }
// Setup the test infrastructure
// expectedTestSpan, eventMatcher := setupInfrastructure(ctx, t, &channel, client, recordEventsPodName, true)
// Assert that the event was seen.
// matches := targetTracker.AssertAtLeast(1, recordevents.MatchEvent(eventMatcher))
// Match the trace
// traceID := getTraceIDHeader(t, matches)
// trace, err := zipkin.JSONTracePred(traceID, 5*time.Minute, func(trace []model.SpanModel) bool {
// tree, err := tracinghelper.GetTraceTree(trace)
// if err != nil {
// return false
// }
// // Do not pass t to prevent unnecessary log output.
// return len(expectedTestSpan.MatchesSubtree(nil, tree)) > 0
// })
// if err != nil {
// t.Logf("Unable to get trace %q: %v. Trace so far %+v", traceID, err, tracinghelper.PrettyPrintTrace(trace))
// tree, err := tracinghelper.GetTraceTree(trace)
// if err != nil {
// t.Fatal(err)
// }
// if len(expectedTestSpan.MatchesSubtree(t, tree)) == 0 {
// t.Fatalf("No matching subtree. want: %v got: %v", expectedTestSpan, tree)
// }
// }

tracingTest helper needs to be redone with OTel. Currently, the old code, that used Zipkin, is commented, but that triggers unused linting error.

  Error: test/conformance/helpers/tracing_test_helper.go:53:3: const recordEventsPodName is unused (unused)
  		recordEventsPodName = "recordevents"
  		^
  Error: test/conformance/helpers/tracing_test_helper.go:98:6: func getTraceIDHeader is unused (unused)
  func getTraceIDHeader(t *testing.T, evInfos []recordevents.EventInfo) string {
       ^

I'll remove commented code in #8851, so this is to track TODO and keep a reference to the old code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions