@@ -72,17 +72,13 @@ import (
7272 "sigs.k8s.io/kueue/pkg/scheduler/preemption"
7373 "sigs.k8s.io/kueue/pkg/util/admissioncheck"
7474 utiltas "sigs.k8s.io/kueue/pkg/util/tas"
75- "sigs.k8s.io/kueue/pkg/util/testing"
75+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
7676 "sigs.k8s.io/kueue/pkg/workload"
7777 "sigs.k8s.io/kueue/pkg/workloadslicing"
7878)
7979
80- const (
81- defaultLogLevel = - 3
82- )
83-
8480var SetupLogger = sync .OnceFunc (func () {
85- ctrl .SetLogger (NewTestingLogger (ginkgo .GinkgoWriter , testing . LogLevelWithDefault ( defaultLogLevel ) ))
81+ ctrl .SetLogger (NewTestingLogger (ginkgo .GinkgoWriter ))
8682})
8783
8884type objAsPtr [T any ] interface {
@@ -116,7 +112,7 @@ func expectObjectToBeDeletedWithTimeout[PtrT objAsPtr[T], T any](ctx context.Con
116112 }
117113 gomega .EventuallyWithOffset (2 , func (g gomega.Gomega ) {
118114 newObj := PtrT (new (T ))
119- g .Expect (k8sClient .Get (ctx , client .ObjectKeyFromObject (o ), newObj )).Should (testing .BeNotFoundError ())
115+ g .Expect (k8sClient .Get (ctx , client .ObjectKeyFromObject (o ), newObj )).Should (utiltesting .BeNotFoundError ())
120116 }, timeout , Interval ).Should (gomega .Succeed ())
121117}
122118
@@ -375,15 +371,15 @@ func ExpectWorkloadToFinish(ctx context.Context, k8sClient client.Client, wlKey
375371 gomega .EventuallyWithOffset (1 , func (g gomega.Gomega ) {
376372 var wl kueue.Workload
377373 g .Expect (k8sClient .Get (ctx , wlKey , & wl )).To (gomega .Succeed ())
378- g .Expect (wl .Status .Conditions ).To (testing .HaveConditionStatusTrue (kueue .WorkloadFinished ), "it's finished" )
374+ g .Expect (wl .Status .Conditions ).To (utiltesting .HaveConditionStatusTrue (kueue .WorkloadFinished ), "it's finished" )
379375 }, LongTimeout , Interval ).Should (gomega .Succeed ())
380376}
381377
382378func ExpectPodsReadyCondition (ctx context.Context , k8sClient client.Client , wlKey client.ObjectKey ) {
383379 gomega .EventuallyWithOffset (1 , func (g gomega.Gomega ) {
384380 var wl kueue.Workload
385381 g .Expect (k8sClient .Get (ctx , wlKey , & wl )).To (gomega .Succeed ())
386- g .Expect (wl .Status .Conditions ).To (testing .HaveConditionStatusTrue (kueue .WorkloadPodsReady ), "pods are ready" )
382+ g .Expect (wl .Status .Conditions ).To (utiltesting .HaveConditionStatusTrue (kueue .WorkloadPodsReady ), "pods are ready" )
387383 }, LongTimeout , Interval ).Should (gomega .Succeed ())
388384}
389385
@@ -1006,11 +1002,12 @@ func ExpectPreemptedCondition(ctx context.Context, k8sClient client.Client, reas
10061002 }, Timeout , Interval ).Should (gomega .Succeed ())
10071003}
10081004
1009- func NewTestingLogger (writer io.Writer , level int ) logr.Logger {
1005+ func NewTestingLogger (writer io.Writer ) logr.Logger {
10101006 opts := func (o * zap.Options ) {
10111007 o .TimeEncoder = zapcore .RFC3339NanoTimeEncoder
10121008 o .ZapOpts = []zaplog.Option {zaplog .AddCaller ()}
10131009 }
1010+ level := utiltesting .LogLevelWithDefault (utiltesting .DefaultLogLevel )
10141011 return zap .New (
10151012 zap .WriteTo (writer ),
10161013 zap .UseDevMode (true ),
@@ -1030,7 +1027,7 @@ func ExpectClusterQueuesToBeActive(ctx context.Context, c client.Client, cqs ...
10301027 readCq := & kueue.ClusterQueue {}
10311028 for _ , cq := range cqs {
10321029 g .Expect (c .Get (ctx , client .ObjectKeyFromObject (cq ), readCq )).To (gomega .Succeed ())
1033- g .Expect (readCq .Status .Conditions ).To (testing .HaveConditionStatusTrue (kueue .ClusterQueueActive ))
1030+ g .Expect (readCq .Status .Conditions ).To (utiltesting .HaveConditionStatusTrue (kueue .ClusterQueueActive ))
10341031 }
10351032 }, Timeout , Interval ).Should (gomega .Succeed ())
10361033}
@@ -1040,7 +1037,7 @@ func ExpectLocalQueuesToBeActive(ctx context.Context, c client.Client, lqs ...*k
10401037 readLq := & kueue.LocalQueue {}
10411038 for _ , lq := range lqs {
10421039 g .Expect (c .Get (ctx , client .ObjectKeyFromObject (lq ), readLq )).To (gomega .Succeed ())
1043- g .Expect (readLq .Status .Conditions ).To (testing .HaveConditionStatusTrue (kueue .LocalQueueActive ))
1040+ g .Expect (readLq .Status .Conditions ).To (utiltesting .HaveConditionStatusTrue (kueue .LocalQueueActive ))
10441041 }
10451042 }, Timeout , Interval ).Should (gomega .Succeed ())
10461043}
0 commit comments