get travis CI green again (#157)

* fix test to work w/ newer grpc repo; run 'make ci' to have it update go.mod and go.sum, trying to repro ci failure locally
* vet w/ go 1.13; use normal go proxy instead of direct in CI
This commit is contained in:
Joshua Humphries
2020-05-12 13:06:14 -04:00
committed by GitHub
parent 8e2cf9b3c2
commit b58182a88d
5 changed files with 53 additions and 22 deletions

View File

@@ -245,7 +245,11 @@ func TestGetAllFiles(t *testing.T) {
expectedFiles := []string{"testing/test.proto"}
// server reflection picks up filename from linked in Go package,
// which indicates "grpc_testing/test.proto", not our local copy.
expectedFilesWithReflection := []string{"grpc_reflection_v1alpha/reflection.proto", "grpc_testing/test.proto"}
expectedFilesWithReflection := [][]string{
{"grpc_reflection_v1alpha/reflection.proto", "grpc_testing/test.proto"},
// depending on the version of grpc, the filenames could be prefixed with "interop/" and "reflection/"
{"interop/grpc_testing/test.proto", "reflection/grpc_reflection_v1alpha/reflection.proto"},
}
for _, ds := range descSources {
t.Run(ds.name, func(t *testing.T) {
@@ -254,11 +258,21 @@ func TestGetAllFiles(t *testing.T) {
t.Fatalf("failed to get all files: %v", err)
}
names := fileNames(files)
expected := expectedFiles
match := false
var expected []string
if ds.includeRefl {
expected = expectedFilesWithReflection
for _, expectedNames := range expectedFilesWithReflection {
expected = expectedNames
if reflect.DeepEqual(expected, names) {
match = true
break
}
}
} else {
expected = expectedFiles
match = reflect.DeepEqual(expected, names)
}
if !reflect.DeepEqual(expected, names) {
if !match {
t.Errorf("GetAllFiles returned wrong results: wanted %v, got %v", expected, names)
}
})