Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/protoc-gen-go-grpc: reuse route_guide_grpc.pb.go as golden file #7134

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions cmd/protoc-gen-go-grpc/protoc-gen-go-grpc_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ popd
protoc \
--go-grpc_out="${TEMPDIR}" \
--go-grpc_opt=paths=source_relative \
"$WORKDIR/testdata/golden.proto"
"examples/route_guide/routeguide/route_guide.proto"

GOLDENFILE="${WORKDIR}/testdata/golden_grpc.pb.go"
GENFILE="${TEMPDIR}/cmd/protoc-gen-go-grpc/testdata/golden_grpc.pb.go"
GOLDENFILE="examples/route_guide/routeguide/route_guide_grpc.pb.go"
GENFILE="${TEMPDIR}/examples/route_guide/routeguide/route_guide_grpc.pb.go"

DIFF=$(diff "${GOLDENFILE}" "${GENFILE}")
# diff is piped to [[ $? == 1 ]] to avoid exiting on diff but exit on error
# (like if the file was not found). See man diff for more info.
DIFF=$(diff "${GOLDENFILE}" "${GENFILE}" || [[ $? == 1 ]])
if [[ -n "${DIFF}" ]]; then
echo -e "ERROR: Generated file golden_grpc.pb.go differs from golden file:\n${DIFF}"
echo -e "ERROR: Generated file differs from golden file:\n${DIFF}"
echo -e "If you have made recent changes to protoc-gen-go-grpc," \
"please regenerate the golden files by running:" \
"\n\t go generate google.golang.org/grpc/..." >&2
Expand Down
249 changes: 0 additions & 249 deletions cmd/protoc-gen-go-grpc/testdata/golden.pb.go

This file was deleted.

38 changes: 0 additions & 38 deletions cmd/protoc-gen-go-grpc/testdata/golden.proto

This file was deleted.

Loading
Loading