Skip to content

Commit

Permalink
Update CI tests to ensure all codegen changes are accounted for in PR
Browse files Browse the repository at this point in the history
Updates the CI tests to ensure that any code generation changes are
accounted for in the PR, and that there were no mistaken changes made
without also running code generation. This change should also help
ensure that code generation order is stable, and there are no ordering
issues with the SDK's codegen.
  • Loading branch information
jasdel committed Jun 5, 2018
1 parent 399dd2d commit c09a866
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ matrix:
- os: osx
go: tip

install:
- make get-deps

script:
- make unit-with-race-cover
- make ci-test

branches:
only:
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SDK_ONLY_PKGS=$(shell go list ./... | grep -v "/vendor/")
SDK_UNIT_TEST_ONLY_PKGS=$(shell go list -tags ${UNIT_TEST_TAGS} ./... | grep -v "/vendor/")
SDK_GO_1_4=$(shell go version | grep "go1.4")
SDK_GO_1_5=$(shell go version | grep "go1.5")
SDK_GO_1_6=$(shell go version | grep "go1.6")
SDK_GO_VERSION=$(shell go version | awk '''{print $$3}''' | tr -d '''\n''')

all: get-deps generate unit
Expand Down Expand Up @@ -60,6 +61,18 @@ unit-with-race-cover: get-deps-tests build verify
@echo "go test SDK and vendor packages"
@go test -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 $(SDK_UNIT_TEST_ONLY_PKGS)

ci-test: ci-test-generate unit-with-race-cover ci-test-generate-validate

ci-test-generate: get-deps
@echo "CI test generated code"
@if [ \( -z "${SDK_GO_1_6}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then make generate; else echo "skipping generate"; fi

ci-test-generate-validate:
@echo "CI test validate no generated code changes"
@gitstatus=`if [ \( -z "${SDK_GO_1_6}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then git status --porcelain; else echo "skipping validation"; fi`; \
echo "$$gitstatus"; \
if [ "$$gitstatus" != "" ]; then exit 1; fi

integration: get-deps-tests integ-custom smoke-tests performance

integ-custom:
Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ phases:
- mkdir -p /go/src/github.com/aws
- ln -s $SDK_CB_ROOT $SDK_GO_ROOT
- cd $SDK_GO_ROOT
- make unit
- make ci-test
- cd $SDK_CB_ROOT
- #echo Compiling the Go code...
post_build:
Expand Down

0 comments on commit c09a866

Please sign in to comment.