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

Switch to testr package #416

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading