Skip to content

Commit

Permalink
Fix build due to unpinned mismatched version of protoc-gen-doc (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-namely authored Nov 29, 2021
1 parent 5d65710 commit b73892b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ RUN ( cd ./grpc-go/cmd/protoc-gen-go-grpc && go install . )

# Go get go-related bins
WORKDIR /tmp
RUN go get -u google.golang.org/grpc
RUN set -e && \
GO111MODULE=on go get google.golang.org/grpc@v$grpc_version

# install protoc-gen-grpc-gateway and protoc-gen-openapiv2
RUN set -e && \
Expand All @@ -87,7 +88,9 @@ RUN go get -u github.com/gogo/protobuf/protoc-gen-gogo
RUN go get -u github.com/gogo/protobuf/protoc-gen-gogofast

RUN go get -u github.com/ckaznocha/protoc-gen-lint
RUN go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

RUN set -e && \
GO111MODULE=on go get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

RUN go get -u github.com/micro/micro/cmd/protoc-gen-micro

Expand Down
15 changes: 15 additions & 0 deletions all/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ testGeneration() {
fi
fi

if [[ "$extra_args" == *"--with-docs"* ]]; then
expected_file_name="/doc/index.html"
if [[ "$extra_args" == *"markdown,index.md"* ]]; then
expected_file_name="/doc/index.md"
fi
if [[ ! -f "$expected_output_dir$expected_file_name" ]]; then
echo "$expected_file_name file was not generated in $expected_output_dir"
exit 1
fi
fi

# Test that we have generated the test.pb.go file.
expected_file_name="/all/test.pb.go"
if [[ "$extra_args" == *"--with-validator"* ]]; then
Expand Down Expand Up @@ -202,6 +213,10 @@ testGeneration() {
echo "Generating for $lang passed!"
}

# Test docs generation
testGeneration go "gen/pb-go" 0 --with-docs
testGeneration go "gen/pb-go" 0 --with-docs markdown,index.md

# Test grpc-gateway generation (only valid for Go)
testGeneration go "gen/pb-go" 0 --with-gateway

Expand Down

0 comments on commit b73892b

Please sign in to comment.