Skip to content

Commit

Permalink
fix: include secrets/config managers in ftltest context
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Mar 4, 2024
1 parent 607d6a0 commit b869dff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion go-runtime/ftl/ftltest/ftltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ package ftltest
import (
"context"

"github.com/TBD54566975/ftl/common/configuration"
"github.com/TBD54566975/ftl/internal/log"
)

// Context suitable for use in testing FTL verbs.
func Context() context.Context {
return log.ContextWithNewDefaultLogger(context.Background())
ctx := log.ContextWithNewDefaultLogger(context.Background())
cm, err := configuration.DefaultConfigMixin{}.NewConfigurationManager(ctx)
if err != nil {
panic(err)
}
ctx = configuration.ContextWithConfig(ctx, cm)
sm, err := configuration.DefaultSecretsMixin{}.NewSecretsManager(ctx)
if err != nil {
panic(err)
}
ctx = configuration.ContextWithSecrets(ctx, sm)
return ctx
}

0 comments on commit b869dff

Please sign in to comment.