Skip to content

Commit

Permalink
Update autosdk test
Browse files Browse the repository at this point in the history
The collector will default to span kind internal. Test that the SDK set
span kind is captured and set.
  • Loading branch information
MrAlias committed Oct 22, 2024
1 parent e7ca24c commit 8939d5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/test/e2e/autosdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (a *app) Run(ctx context.Context, user string, admin bool, in <-chan msg) e
attribute.Bool("admin", admin),
),
trace.WithTimestamp(y2k.Add(500 * time.Microsecond)),
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithSpanKind(trace.SpanKindServer),
}
_, span := a.tracer.Start(ctx, "Run", opts...)
defer span.End(trace.WithTimestamp(y2k.Add(1 * time.Second)))
Expand Down
7 changes: 1 addition & 6 deletions internal/test/e2e/autosdk/verify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ SCOPE="go.opentelemetry.io/auto/internal/test/e2e/autosdk"
assert_regex "$timestamp" "946684805000000000"
}

@test "autosdk :: main span :: kind" {
kind=$(spans_from_scope_named ${SCOPE} | jq "select(.name == \"main\")" | jq ".kind")
assert_equal "$kind" "3"
}

@test "autosdk :: main span :: event" {
event=$(span_events ${SCOPE} "main")

Expand Down Expand Up @@ -128,7 +123,7 @@ SCOPE="go.opentelemetry.io/auto/internal/test/e2e/autosdk"

@test "autosdk :: Run span :: kind" {
kind=$(spans_from_scope_named ${SCOPE} | jq "select(.name == \"Run\")" | jq ".kind")
assert_equal "$kind" "1"
assert_equal "$kind" "2"
}

@test "autosdk :: Run span :: attribute :: user" {
Expand Down

0 comments on commit 8939d5d

Please sign in to comment.