@@ -23,6 +23,7 @@ import (
23
23
"testing"
24
24
25
25
"github.com/stretchr/testify/assert"
26
+ "github.com/stretchr/testify/require"
26
27
27
28
resourceapi "k8s.io/api/resource/v1alpha3"
28
29
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -307,7 +308,7 @@ func TestClaimInfoHasPodReference(t *testing.T) {
307
308
},
308
309
} {
309
310
t .Run (test .description , func (t * testing.T ) {
310
- assert .Equal (t , test .claimInfo .hasPodReference (podUID ), test . expectedResult )
311
+ assert .Equal (t , test .expectedResult , test . claimInfo .hasPodReference (podUID ))
311
312
})
312
313
}
313
314
}
@@ -401,7 +402,7 @@ func TestClaimInfoIsPrepared(t *testing.T) {
401
402
},
402
403
} {
403
404
t .Run (test .description , func (t * testing.T ) {
404
- assert .Equal (t , test .claimInfo .isPrepared (), test . expectedResult )
405
+ assert .Equal (t , test .expectedResult , test . claimInfo .isPrepared ())
405
406
})
406
407
}
407
408
}
@@ -440,7 +441,7 @@ func TestNewClaimInfoCache(t *testing.T) {
440
441
assert .Error (t , err )
441
442
return
442
443
}
443
- assert .NoError (t , err )
444
+ require .NoError (t , err )
444
445
assert .NotNil (t , result )
445
446
})
446
447
}
@@ -494,7 +495,7 @@ func TestClaimInfoCacheWithLock(t *testing.T) {
494
495
} {
495
496
t .Run (test .description , func (t * testing.T ) {
496
497
cache , err := newClaimInfoCache (t .TempDir (), "test-checkpoint" )
497
- assert .NoError (t , err )
498
+ require .NoError (t , err )
498
499
assert .NotNil (t , cache )
499
500
err = cache .withLock (test .funcGen (cache ))
500
501
if test .wantErr {
@@ -554,7 +555,7 @@ func TestClaimInfoCacheWithRLock(t *testing.T) {
554
555
} {
555
556
t .Run (test .description , func (t * testing.T ) {
556
557
cache , err := newClaimInfoCache (t .TempDir (), "test-checkpoint" )
557
- assert .NoError (t , err )
558
+ require .NoError (t , err )
558
559
assert .NotNil (t , cache )
559
560
err = cache .withRLock (test .funcGen (cache ))
560
561
if test .wantErr {
@@ -583,7 +584,7 @@ func TestClaimInfoCacheAdd(t *testing.T) {
583
584
} {
584
585
t .Run (test .description , func (t * testing.T ) {
585
586
cache , err := newClaimInfoCache (t .TempDir (), "test-checkpoint" )
586
- assert .NoError (t , err )
587
+ require .NoError (t , err )
587
588
assert .NotNil (t , cache )
588
589
cache .add (test .claimInfo )
589
590
assert .True (t , cache .contains (test .claimInfo .ClaimName , test .claimInfo .Namespace ))
@@ -754,13 +755,13 @@ func TestSyncToCheckpoint(t *testing.T) {
754
755
} {
755
756
t .Run (test .description , func (t * testing.T ) {
756
757
cache , err := newClaimInfoCache (test .stateDir , test .checkpointName )
757
- assert .NoError (t , err )
758
+ require .NoError (t , err )
758
759
err = cache .syncToCheckpoint ()
759
760
if test .wantErr {
760
761
assert .Error (t , err )
761
762
return
762
763
}
763
- assert .NoError (t , err )
764
+ require .NoError (t , err )
764
765
})
765
766
}
766
767
}
0 commit comments