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
…#183)

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 authored May 26, 2019
1 parent 8803769 commit b157143
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
31 changes: 15 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ language: go

sudo: required

os:
- linux
- osx
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
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip

install:
- make get-deps
matrix:
allow_failures:
- go: tip

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

matrix:
allow_failures:
- go: tip
branches:
only:
- master
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ unit-with-race-cover: verify
@echo "go test SDK and vendor packages"
@go test -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 ${SDK_ALL_PKGS}

#ci-test: generate unit-with-race-cover ci-test-generate-validate
#
#ci-test-generate-validate:
# @echo "CI test validate no generated code changes"
# git add . -A
# gitstatus=`git diff --cached --ignore-space-change`; \
# echo "$$gitstatus"; \
# if [ "$$gitstatus" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then echo "$$gitstatus"; exit 1; fi
ci-test: generate unit-with-race-cover ci-test-generate-validate

ci-test-generate-validate:
@echo "CI test validate no generated code changes"
git update-index --assume-unchanged go.mod go.sum
git add . -A
gitstatus=`git diff --cached --ignore-space-change`; \
git update-index --no-assume-unchanged go.mod go.sum
echo "$$gitstatus"; \
if [ "$$gitstatus" != "" ]; then echo "$$gitstatus"; exit 1; fi

#######################
# Integration Testing #
Expand Down
2 changes: 1 addition & 1 deletion buildspec-NoGoMods.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 get-deps unit
- make get-deps ci-test
- cd $SDK_CB_ROOT
post_build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ phases:
- echo Build started on `date`
- export GOPATH=/go
- export SDK_CODEBUILD_ROOT=`pwd`
- make get-deps-verify unit
- make get-deps-verify ci-test
post_build:
commands:
- echo Build completed on `date`

0 comments on commit b157143

Please sign in to comment.