Skip to content

Commit

Permalink
test: added check for generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianciutea committed Nov 19, 2021
1 parent f7f2692 commit 49637c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ code-gen: code-gen-deps
@($(DOCKER_THRIFT) thrift -r --out src/main/java/ --gen java ./commons/nrjmx.thrift)
@($(DOCKER_THRIFT) thrift -r --out src/go/ --gen go:package=protocol ./commons/nrjmx.thrift)

TRACKED_GEN_DIR=src/main/java/protocol \
src/go/protocol
.PHONY : check-gen-code
check-gen-code: code-gen
@echo "Checking the generated code..." ; \
if [ `git status --porcelain --untracked-files=no $(TRACKED_GEN_DIR) | wc -l` -gt 0 ]; then \
echo "Code generator produced different code, make sure you pushed the latest changes!"; \
exit 1; \
fi

1 change: 1 addition & 0 deletions src/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/newrelic/nrjmx
go 1.14

require (
github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use // indirect
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-connections v0.4.0
github.com/newrelic/infra-integrations-sdk v3.7.0+incompatible
Expand Down
3 changes: 3 additions & 0 deletions src/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.15.0 h1:aGvdaR0v1t9XLgjtBYwxcBvBOTMqClzwE26CHOgjW1Y=
github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use h1:xsANrjjFgHGZdvm+CH11MokyE+otra0nzE6s6h4AYao=
github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use/go.mod h1:DFhKuRr6Y5sTnmWbwMaNNsb2Sb191zcHZCUmz+x3YsM=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
Expand Down

0 comments on commit 49637c2

Please sign in to comment.