From ced629e657a67da0d5d483a3283b404ee25f4a48 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 14 Aug 2021 10:49:17 -0700 Subject: [PATCH] Svc REST: Add proof funcs in feature test logic Allows for more control of tests to assert specific things. --- pkg/registry/core/service/storage/storage_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/registry/core/service/storage/storage_test.go b/pkg/registry/core/service/storage/storage_test.go index b1f63dd20f2..79dfeab5cfb 100644 --- a/pkg/registry/core/service/storage/storage_test.go +++ b/pkg/registry/core/service/storage/storage_test.go @@ -5826,8 +5826,13 @@ type svcTestCase struct { expectHeadless bool expectNodePorts bool expectHealthCheckNodePort bool + + // Additional proofs, provided by the tests which use this. + prove []svcTestProof } +type svcTestProof func(t *testing.T, storage *GenericREST, before, after *api.Service) + func callName(before, after *api.Service) string { if before == nil && after != nil { return "create" @@ -6287,6 +6292,10 @@ func verifyExpectations(t *testing.T, storage *GenericREST, tc svcTestCase, befo } else { proveHealthCheckNodePortDeallocated(t, storage, before, after) } + + for _, p := range tc.prove { + p(t, storage, before, after) + } } func TestFeatureExternalName(t *testing.T) {