Skip to content

Commit

Permalink
test: Add logger to framework's context (#557)
Browse files Browse the repository at this point in the history
Make logger accessible inside context for easier consumption by
test cases and other functions
  • Loading branch information
danielfbm authored Mar 15, 2024
1 parent 0a7967a commit 55039d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testing/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"testing"
"time"

"knative.dev/pkg/logging"
. "github.com/katanomi/pkg/testing/framework/base"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -57,6 +58,7 @@ func (f *Framework) init() {
panic(err)
}
f.SugaredLogger = logger.Sugar()
f.Context = logging.WithLogger(f.Context, f.SugaredLogger)
}

// MRun main testing.M run
Expand Down

0 comments on commit 55039d3

Please sign in to comment.