Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for NilChance (0.76 sec)

  1. pkg/kubelet/server/stats/summary_windows_test.go

    	assert.Equal(summary.Pods, podStats)
    }
    
    func getFsStats() *statsapi.FsStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.FsStats{}
    	f.Fuzz(v)
    	return v
    }
    
    func getContainerStats() *statsapi.ContainerStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.ContainerStats{}
    	f.Fuzz(v)
    	return v
    }
    
    func getPodStats() *statsapi.PodStats {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/api/meta/meta_test.go

    	metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
    
    	"github.com/google/go-cmp/cmp"
    	fuzz "github.com/google/gofuzz"
    )
    
    func TestAsPartialObjectMetadata(t *testing.T) {
    	f := fuzz.New().NilChance(.5).NumElements(0, 1).RandSource(rand.NewSource(1))
    
    	for i := 0; i < 100; i++ {
    		m := &metav1.ObjectMeta{}
    		f.Fuzz(m)
    		partial := AsPartialObjectMetadata(m)
    		if !reflect.DeepEqual(&partial.ObjectMeta, m) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go

    // FuzzerFor can randomly populate api objects that are destined for version.
    func FuzzerFor(funcs FuzzerFuncs, src rand.Source, codecs runtimeserializer.CodecFactory) *fuzz.Fuzzer {
    	f := fuzz.New().NilChance(.5).NumElements(0, 1)
    	if src != nil {
    		f.RandSource(src)
    	}
    	f.Funcs(funcs(codecs)...)
    	return f
    }
    
    // MergeFuzzerFuncs will merge the given funcLists, overriding early funcs with later ones if there first
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 01 19:31:12 UTC 2018
    - 1.6K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/kubeopenapi_test.go

    			case 3:
    				s.Object = []interface{}{}
    			case 4:
    				s.Object = map[string]interface{}{}
    			case 5:
    				s.Object = nil
    			case 6:
    				s.Object = int64(42)
    			}
    		},
    	)
    	f.MaxDepth(3)
    	f.NilChance(0.5)
    
    	for i := 0; i < 10000; i++ {
    		orig := &Structural{}
    		f.Fuzz(orig)
    
    		// normalize Structural.ValueValidation to zero values if it was nil before
    		normalizer := Visitor{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:16 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/convert_test.go

    			if s.Schema != nil {
    				s.Allows = false
    			}
    		},
    		func(s **string, c fuzz.Continue) {
    			c.FuzzNoCustom(s)
    			if *s != nil && **s == "" {
    				*s = nil
    			}
    		},
    	)
    
    	f.MaxDepth(2)
    	f.NilChance(0.5)
    
    	for i := 0; i < 10000; i++ {
    		// fuzz a random field in JSONSchemaProps
    		origSchema := &apiextensions.JSONSchemaProps{}
    		x := reflect.ValueOf(origSchema).Elem()
    		n := rand.Intn(x.NumField())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 23 02:09:41 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  6. pkg/registry/rbac/helpers_test.go

    		if tc.expected != actual {
    			t.Errorf("%s: expected %v, got %v", tc.name, tc.expected, actual)
    		}
    	}
    }
    
    func TestNewMetadataFields(t *testing.T) {
    	f := fuzz.New().NilChance(0.0).NumElements(1, 1)
    	for i := 0; i < 100; i++ {
    		objMeta := metav1.ObjectMeta{}
    		f.Fuzz(&objMeta)
    		objMeta.Name = ""
    		objMeta.GenerateName = ""
    		objMeta.Namespace = ""
    		objMeta.SelfLink = ""
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 20:12:50 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/helpers_test.go

    		}
    	}
    }
    
    func TestResetObjectMetaForStatus(t *testing.T) {
    	meta := &ObjectMeta{}
    	existingMeta := &ObjectMeta{}
    
    	// fuzz the existingMeta to set every field, no nils
    	f := fuzz.New().NilChance(0).NumElements(1, 1).MaxDepth(10)
    	f.Fuzz(existingMeta)
    	ResetObjectMetaForStatus(meta, existingMeta)
    
    	// not all fields are stomped during the reset.  These fields should not have been set. False
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/test/api_meta_help_test.go

    		}
    	}
    }
    
    func TestSetExtractListRoundTrip(t *testing.T) {
    	scheme := runtime.NewScheme()
    	codecs := serializer.NewCodecFactory(scheme)
    	fuzzer := fuzz.New().NilChance(0).NumElements(1, 5).Funcs(metafuzzer.Funcs(codecs)...).MaxDepth(10)
    	for i := 0; i < 5; i++ {
    		start := &testapigroup.CarpList{}
    		fuzzer.Fuzz(&start.Items)
    
    		list, err := meta.ExtractList(start)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 8.5K bytes
    - Viewed (0)
Back to top