Skip to content

Commit

Permalink
Integration test framework (#366)
Browse files Browse the repository at this point in the history
* Add helper methods for integration test framework
Export kanctl helper methods for integration tests

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>

* Add integration_test.go
Add new make rule "make integration-test"

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>

* Add rds-postgres app e2e integration test

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>

* Add profile object to integration test suite
Validate Blueprint with app object references

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
  • Loading branch information
PrasadG193 authored and mergify[bot] committed Nov 11, 2019
1 parent 4b0a0a4 commit 5b06ff1
Show file tree
Hide file tree
Showing 12 changed files with 1,181 additions and 72 deletions.
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

0 comments on commit 5b06ff1

Please sign in to comment.