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.

V2 port of: aws/aws-sdk-go#1966
  • Loading branch information
jasdel committed Jun 6, 2018
1 parent b82e064 commit 6cc237c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 21 deletions.
45 changes: 25 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
language: go

sudo: required

go:
- 1.5
- 1.6
- 1.7
- 1.8
- 1.9
- tip

# Use Go 1.5's vendoring experiment for 1.5 tests.
env:
- GO15VENDOREXPERIMENT=1

install:
- make get-deps
matrix:
allow_failures:
- go: tip
include:
- os: linux
sudo: required
- os: linux
sudo: required
go: 1.9.x
- os: linux
sudo: required
go: 1.10.x
- os: linux
sudo: required
go: tip
- os: osx
go: 1.9.x
- os: osx
go: 1.10.x
- os: osx
go: tip

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

matrix:
allow_failures:
- go: tip
branches:
only:
- master
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''')
SDK_V1_USAGE=$(shell go list -f '''{{ if not .Standard }}{{ range $$_, $$name := .Imports }} * {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ end }}''' ./... | sort -u | grep '''/aws-sdk-go/''')

Expand Down Expand Up @@ -65,6 +66,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" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then git diff; 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 @@ -12,7 +12,7 @@ phases:
- cd $SDK_GO_ROOT
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
- make unit
- make ci-test
- cd $SDK_CB_ROOT
post_build:
commands:
Expand Down

0 comments on commit 6cc237c

Please sign in to comment.