Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Switch to testr package
Browse files Browse the repository at this point in the history
The logr/testing package was deprecated in favor of the logr/testr
package. There are no changes in functionality as the logr/testing
package is implemented using the logr/testr package.

Signed-off-by: Scott Andrews <andrewssc@vmware.com>
  • Loading branch information
scothis committed Aug 28, 2023
1 parent 2772a61 commit eafbf75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions testing/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/go-logr/logr"
logrtesting "github.com/go-logr/logr/testing"
"github.com/go-logr/logr/testr"
"github.com/google/go-cmp/cmp"
"github.com/vmware-labs/reconciler-runtime/reconcilers"
rtime "github.com/vmware-labs/reconciler-runtime/time"
Expand Down Expand Up @@ -144,7 +144,7 @@ func (tc *ReconcilerTestCase) Run(t *testing.T, scheme *runtime.Scheme, factory
tc.Now = time.Now()
}
ctx = rtime.StashNow(ctx, tc.Now)
ctx = logr.NewContext(ctx, logrtesting.NewTestLogger(t))
ctx = logr.NewContext(ctx, testr.New(t))
if deadline, ok := t.Deadline(); ok {
var cancel context.CancelFunc
ctx, cancel = context.WithDeadline(ctx, deadline)
Expand Down
4 changes: 2 additions & 2 deletions testing/subreconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/go-logr/logr"
logrtesting "github.com/go-logr/logr/testing"
"github.com/go-logr/logr/testr"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/vmware-labs/reconciler-runtime/internal"
Expand Down Expand Up @@ -148,7 +148,7 @@ func (tc *SubReconcilerTestCase[T]) Run(t *testing.T, scheme *runtime.Scheme, fa
tc.Now = time.Now()
}
ctx = rtime.StashNow(ctx, tc.Now)
ctx = logr.NewContext(ctx, logrtesting.NewTestLogger(t))
ctx = logr.NewContext(ctx, testr.New(t))
if deadline, ok := t.Deadline(); ok {
var cancel context.CancelFunc
ctx, cancel = context.WithDeadline(ctx, deadline)
Expand Down
4 changes: 2 additions & 2 deletions testing/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"

"github.com/go-logr/logr"
logrtesting "github.com/go-logr/logr/testing"
"github.com/go-logr/logr/testr"
"github.com/google/go-cmp/cmp"
"github.com/vmware-labs/reconciler-runtime/reconcilers"
rtime "github.com/vmware-labs/reconciler-runtime/time"
Expand Down Expand Up @@ -137,7 +137,7 @@ func (tc *AdmissionWebhookTestCase) Run(t *testing.T, scheme *runtime.Scheme, fa
tc.Now = time.Now()
}
ctx = rtime.StashNow(ctx, tc.Now)
ctx = logr.NewContext(ctx, logrtesting.NewTestLogger(t))
ctx = logr.NewContext(ctx, testr.New(t))
if deadline, ok := t.Deadline(); ok {
var cancel context.CancelFunc
ctx, cancel = context.WithDeadline(ctx, deadline)
Expand Down

0 comments on commit eafbf75

Please sign in to comment.