Skip to content

Commit ffd64b7

Browse files
authored
test traces fix (#1185)
1 parent 1406ee1 commit ffd64b7

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

tests/scenarios/actions.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func SetRequestsUndo(ctx gobdd.Context, value map[string]map[string]UndoAction)
105105
}
106106

107107
type clientKeys struct{}
108-
type authenticatedContext struct{}
109108
type ctxRequestsUndoKey struct{}
110109

111110
func ConfigureClients(ctx gobdd.Context, cctx context.Context) (context.Context, func()) {
@@ -137,16 +136,6 @@ func ConfigureClients(ctx gobdd.Context, cctx context.Context) (context.Context,
137136
c1.GetConfig().HTTPClient = &httpClient
138137
c2.GetConfig().HTTPClient = &httpClient
139138

140-
ctx.Set(
141-
authenticatedContext{},
142-
testsV1.WithTestAuth(
143-
testsV2.WithTestAuth(
144-
testsV1.NewDefaultContext(
145-
testsV2.NewDefaultContext(cctx),
146-
),
147-
),
148-
),
149-
)
150139
clients := map[string]reflect.Value{
151140
"v1": reflect.ValueOf(c1),
152141
"v2": reflect.ValueOf(c2),
@@ -158,11 +147,13 @@ func ConfigureClients(ctx gobdd.Context, cctx context.Context) (context.Context,
158147
}
159148

160149
func getAuthenticatedContext(ctx gobdd.Context) context.Context {
161-
authenticatedContext, err := ctx.Get(authenticatedContext{})
162-
if err != nil {
163-
GetT(ctx).Fatalf("can't get authenticated context: %v", err)
164-
}
165-
return authenticatedContext.(context.Context)
150+
return testsV1.WithTestAuth(
151+
testsV2.WithTestAuth(
152+
testsV1.NewDefaultContext(
153+
testsV2.NewDefaultContext(GetCtx(ctx)),
154+
),
155+
),
156+
)
166157
}
167158

168159
func GetClientVersion(ctx gobdd.Context, version string) (reflect.Value, error) {

0 commit comments

Comments
 (0)