storage/etcd3: make some list tests generic

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
This commit is contained in:
Steve Kuznetsov 2022-05-12 15:13:23 -07:00
parent 8fcf00ef91
commit a8067f8e86
No known key found for this signature in database
GPG Key ID: 8821C29EC988D9B4

View File

@ -521,8 +521,12 @@ func TestTransformationFailure(t *testing.T) {
}
func TestList(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RemainingItemCount, true)()
ctx, store, _ := testSetup(t)
RunTestList(ctx, t, store)
}
func RunTestList(ctx context.Context, t *testing.T, store storage.Interface) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RemainingItemCount, true)()
initialRV, preset, err := seedMultiLevelData(ctx, store)
if err != nil {
@ -964,8 +968,12 @@ func TestList(t *testing.T) {
}
func TestListWithoutPaging(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RemainingItemCount, true)()
ctx, store, _ := testSetup(t, withoutPaging())
RunTestListWithoutPaging(ctx, t, store)
}
func RunTestListWithoutPaging(ctx context.Context, t *testing.T, store storage.Interface) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.RemainingItemCount, true)()
_, preset, err := seedMultiLevelData(ctx, store)
if err != nil {