Skip to content

Commit

Permalink
Multiple optimizations to build targets
Browse files Browse the repository at this point in the history
* Clean up e2e test on interruption
* Leverage GOCACHE for faster builds
* Forward container STDIN in make targets
  • Loading branch information
antoineco committed Jul 20, 2018
1 parent e211101 commit 0c7b948
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ site
# temporal github pages
gh-pages

test/binaries
# Docker-based builds
/test/binaries
/.env
/.gocache/
/bin/
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static-check:
test:
@$(DEF_VARS) \
NODE_IP=$(NODE_IP) \
DOCKER_OPTS="--net=host" \
DOCKER_OPTS="-i --net=host" \
build/go-in-docker.sh build/test.sh

.PHONY: lua-test
Expand All @@ -182,14 +182,14 @@ e2e-test:
@$(DEF_VARS) \
FOCUS=$(FOCUS) \
E2E_NODES=$(E2E_NODES) \
DOCKER_OPTS="--net=host" \
DOCKER_OPTS="-i --net=host" \
NODE_IP=$(NODE_IP) \
build/go-in-docker.sh build/e2e-tests.sh

.PHONY: cover
cover:
@$(DEF_VARS) \
DOCKER_OPTS="--net=host" \
DOCKER_OPTS="-i --net=host" \
build/go-in-docker.sh build/cover.sh

echo "Uploading coverage results..."
Expand Down
1 change: 1 addition & 0 deletions build/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fi

ginkgo build ./test/e2e

exec -- \
ginkgo \
-randomizeSuites \
-randomizeAllSpecs \
Expand Down
1 change: 1 addition & 0 deletions build/go-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ docker run \
-v ${HOME}/.kube:/${HOME}/.kube \
-v ${HOME}/.minikube:${HOME}/.minikube \
-v ${PWD}:/go/src/${PKG} \
-v ${PWD}/.gocache:${HOME}/.cache/go-build \
-v ${PWD}/bin/${ARCH}:/go/bin/linux_${ARCH} \
-w /go/src/${PKG} \
--env-file .env \
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ func RunE2ETests(t *testing.T) {
glog.Infof("Starting e2e run %q on Ginkgo node %d", framework.RunID, config.GinkgoConfig.ParallelNode)
ginkgo.RunSpecs(t, "nginx-ingress-controller e2e suite")
}

var _ = ginkgo.SynchronizedAfterSuite(func() {
// Run on all Ginkgo nodes
framework.Logf("Running AfterSuite actions on all nodes")
framework.RunCleanupActions()
}, func() {})

0 comments on commit 0c7b948

Please sign in to comment.