Skip to content

Commit 0656135

Browse files
authored
Unity tracer test name (#1175)
Let's use the original scenario name for the tracer test.name.
1 parent 122d524 commit 0656135

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/scenarios/scenarios_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ func TestScenarios(t *testing.T) {
6060
ct, _ := ctx.Get(gobdd.TestingTKey{})
6161
tt := ct.(*testing.T)
6262
testParts := strings.Split(tt.Name(), "/")
63+
testName := strings.ReplaceAll(strings.TrimPrefix(testParts[3], "Scenario_"), "_", " ")
6364
cctx, closeSpan := ddtesting.StartTestWithContext(
6465
datadog.NewDefaultContext(context.Background()),
6566
tt,
6667
ddtesting.WithSpanOptions(
6768
// Override the default tags set by ddtesting package for bdd
68-
tracer.Tag("test.name", testParts[3]),
69+
tracer.Tag("test.name", testName),
6970
tracer.Tag("test.suite", fmt.Sprintf("%s/%s", version, testParts[2])),
7071
tracer.Tag("test.framework", "github.com/go-bdd/gobdd"),
7172
// Set resource name to TestName

0 commit comments

Comments
 (0)