mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #40594 from deads2k/restore-testing
Restore unit testing for staging repos
This commit is contained in:
		@@ -55,6 +55,8 @@ make generated_files
 | 
			
		||||
go install ./cmd/...
 | 
			
		||||
./hack/install-etcd.sh
 | 
			
		||||
 | 
			
		||||
# bazel didn't like BUILD files in the staging repos, so we need to run unit tests
 | 
			
		||||
make test WHAT="./vendor/k8s.io/apimachinery/... ./vendor/k8s.io/apiserver/... ./vendor/k8s.io/client-go/..."
 | 
			
		||||
make test-cmd
 | 
			
		||||
make test-integration
 | 
			
		||||
./hack/test-update-storage-objects.sh
 | 
			
		||||
 
 | 
			
		||||
@@ -141,7 +141,7 @@ stuff: 1
 | 
			
		||||
		t.Fatal("expected error with yaml: violate, got no error")
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf("err: %s\n", err.Error())
 | 
			
		||||
	if !strings.HasPrefix(err.Error(), "yaml: line 2:") {
 | 
			
		||||
	if !strings.Contains(err.Error(), "yaml: line 2:") {
 | 
			
		||||
		t.Fatalf("expected %q to have 'yaml: line 2:' found a tab character", err.Error())
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ import (
 | 
			
		||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
 | 
			
		||||
// for a real clientset and is mostly useful in simple unit tests.
 | 
			
		||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
 | 
			
		||||
	o := testing.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
 | 
			
		||||
	o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
 | 
			
		||||
	for _, obj := range objects {
 | 
			
		||||
		if err := o.Add(obj); err != nil {
 | 
			
		||||
			panic(err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user