proto: fix RoundTrip test for enterprise (#8826)

This commit is contained in:
Daniel Nephin 2020-10-06 09:55:50 -04:00 committed by GitHub
parent 356998d91e
commit 3fe95f17d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -10,12 +10,13 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
fuzz "github.com/google/gofuzz" fuzz "github.com/google/gofuzz"
"github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/structs"
) )
func TestNewCheckServiceNodeFromStructs_RoundTrip(t *testing.T) { func TestNewCheckServiceNodeFromStructs_RoundTrip(t *testing.T) {
repeat(t, func(t *testing.T, fuzzer *fuzz.Fuzzer) { repeat(t, func(t *testing.T, fuzzer *fuzz.Fuzzer) {
fuzzer.Funcs(randInt32, randUint32, randInterface, randStructsUpstream) fuzzer.Funcs(randInt32, randUint32, randInterface, randStructsUpstream, randEnterpriseMeta)
var target structs.CheckServiceNode var target structs.CheckServiceNode
fuzzer.Fuzz(&target) fuzzer.Fuzz(&target)
@ -107,3 +108,8 @@ func randInterface(m *interface{}, c fuzz.Continue) {
} }
} }
} }
// TODO(streaming): this is a quick fix to get the tests passing in enterprise.
// This needs to use a real random value once enterprise support is complete.
func randEnterpriseMeta(_ *structs.EnterpriseMeta, _ fuzz.Continue) {
}