Skip to content

Commit b157143

Browse files
authored
Update CI tests to ensure all codegen changes are accounted for in PR (#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
1 parent 8803769 commit b157143

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

.travis.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@ language: go
22

33
sudo: required
44

5+
os:
6+
- linux
7+
- osx
58
go:
6-
- 1.5
7-
- 1.6
8-
- 1.7
9-
- 1.8
10-
- 1.9
11-
- tip
12-
13-
# Use Go 1.5's vendoring experiment for 1.5 tests.
14-
env:
15-
- GO15VENDOREXPERIMENT=1
9+
- 1.9.x
10+
- 1.10.x
11+
- 1.11.x
12+
- 1.12.x
13+
- tip
1614

17-
install:
18-
- make get-deps
15+
matrix:
16+
allow_failures:
17+
- go: tip
1918

2019
script:
21-
- make unit-with-race-cover
20+
make ci-test;
2221

23-
matrix:
24-
allow_failures:
25-
- go: tip
22+
branches:
23+
only:
24+
- master

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ unit-with-race-cover: verify
6565
@echo "go test SDK and vendor packages"
6666
@go test -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 ${SDK_ALL_PKGS}
6767

68-
#ci-test: generate unit-with-race-cover ci-test-generate-validate
69-
#
70-
#ci-test-generate-validate:
71-
# @echo "CI test validate no generated code changes"
72-
# git add . -A
73-
# gitstatus=`git diff --cached --ignore-space-change`; \
74-
# echo "$$gitstatus"; \
75-
# if [ "$$gitstatus" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then echo "$$gitstatus"; exit 1; fi
68+
ci-test: generate unit-with-race-cover ci-test-generate-validate
69+
70+
ci-test-generate-validate:
71+
@echo "CI test validate no generated code changes"
72+
git update-index --assume-unchanged go.mod go.sum
73+
git add . -A
74+
gitstatus=`git diff --cached --ignore-space-change`; \
75+
git update-index --no-assume-unchanged go.mod go.sum
76+
echo "$$gitstatus"; \
77+
if [ "$$gitstatus" != "" ]; then echo "$$gitstatus"; exit 1; fi
7678

7779
#######################
7880
# Integration Testing #

buildspec-NoGoMods.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ phases:
1010
- mkdir -p /go/src/github.com/aws
1111
- ln -s $SDK_CB_ROOT $SDK_GO_ROOT
1212
- cd $SDK_GO_ROOT
13-
- make get-deps unit
13+
- make get-deps ci-test
1414
- cd $SDK_CB_ROOT
1515
post_build:
1616
commands:

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ phases:
66
- echo Build started on `date`
77
- export GOPATH=/go
88
- export SDK_CODEBUILD_ROOT=`pwd`
9-
- make get-deps-verify unit
9+
- make get-deps-verify ci-test
1010
post_build:
1111
commands:
1212
- echo Build completed on `date`

0 commit comments

Comments
 (0)