From 4d4203f7fdec46e84f7ae2b393993de57ff4f640 Mon Sep 17 00:00:00 2001 From: Gaetan de Villele Date: Thu, 27 Apr 2017 15:57:35 -0700 Subject: [PATCH] =?UTF-8?q?add=20=E2=80=9Ctest=E2=80=9D=20target=20and=20m?= =?UTF-8?q?ake=20CI=20use=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gaetan de Villele --- Makefile | 5 +++++ docker.Makefile | 4 ++++ dockerfiles/Dockerfile.ci | 1 + 3 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index d8a54239b6..2ddc4063e5 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,11 @@ build: clean clean: @rm -rf ./build +# run go test +# the "-tags daemon" part is temporary +test: + @go test -tags daemon -v $(shell go list ./... | grep -v /vendor/) + # build the CLI for multiple architectures cross: clean @gox -output build/docker-{{.OS}}-{{.Arch}} \ diff --git a/docker.Makefile b/docker.Makefile index 66b48c4036..ee03ce0fe5 100644 --- a/docker.Makefile +++ b/docker.Makefile @@ -21,6 +21,10 @@ build: build_docker_image clean: build_docker_image @docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make clean +# run go test +test: build_docker_image + @docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make test + # build the CLI for multiple architectures using a container cross: build_docker_image @docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make cross diff --git a/dockerfiles/Dockerfile.ci b/dockerfiles/Dockerfile.ci index 52b3644ab1..29918badab 100644 --- a/dockerfiles/Dockerfile.ci +++ b/dockerfiles/Dockerfile.ci @@ -25,5 +25,6 @@ ENV CGO_ENABLED=0 WORKDIR /go/src/github.com/docker/cli RUN make cross +RUN make test CMD sh