Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration test framework #366

Merged
merged 5 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ DOCKER_CONFIG ?= "$(HOME)/.docker"

SRC_DIRS := cmd pkg # directories which hold app source (not vendored)

INTEGRATION_TEST_DIR := pkg/testing # directory which hold workflow tests

ALL_ARCH := amd64 arm arm64 ppc64le

# Set default base image dynamically for each arch
Expand Down Expand Up @@ -166,6 +168,9 @@ deploy: release-controller .deploy-$(DOTFILE_IMAGE)
test: build-dirs
@$(MAKE) run CMD='-c "./build/test.sh $(SRC_DIRS)"'

integration-test: build-dirs
@$(MAKE) run CMD='-c "TEST_INTEGRATION=true ./build/test.sh $(INTEGRATION_TEST_DIR)"'

codegen:
@$(MAKE) run CMD='-c "./build/codegen.sh"'

Expand Down
11 changes: 8 additions & 3 deletions build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ export CGO_ENABLED=0
export GO111MODULE=on

TARGETS=$(for d in "$@"; do echo ./$d/...; done)
TAGS=""

if [[ -n "${TEST_INTEGRATION+x}" ]]; then
TAGS="-tags=integration -timeout 30m"
fi

echo "Running tests:"
go test -v -installsuffix "static" -i ${TARGETS}
go test -v ${TARGETS} -list .
go test -v -installsuffix "static" ${TARGETS} -check.v
go test -v ${TAGS} -installsuffix "static" -i ${TARGETS}
go test -v ${TAGS} ${TARGETS} -list .
go test -v ${TAGS} -installsuffix "static" ${TARGETS} -check.v
echo

echo -n "Checking gofmt: "
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ require (
github.com/json-iterator/go v1.1.6
github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/kubernetes-csi/external-snapshotter v1.1.0
github.com/lib/pq v1.2.0
github.com/luci/go-render v0.0.0-20160219211803-9a04cc21af0f
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kubernetes-csi/external-snapshotter v1.1.0 h1:godlw8BSOac5TMGH2rVPJrmllek3y8wuqd9JsJHgulw=
github.com/kubernetes-csi/external-snapshotter v1.1.0/go.mod h1:oYfxnsuh48V1UDYORl77YQxQbbdokNy7D73phuFpksY=
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/luci/go-render v0.0.0-20160219211803-9a04cc21af0f h1:WVPqVsbUsrzAebTEgWRAZMdDOfkFx06iyhbIoyMgtkE=
github.com/luci/go-render v0.0.0-20160219211803-9a04cc21af0f/go.mod h1:aS446i8akEg0DAtNKTVYpNpLPMc0SzsZ0RtGhjl0uFM=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
Loading