From 71e45d920788984e15465c97aa6eae5897a24cd9 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 Upstream-commit: 4d4203f7fdec46e84f7ae2b393993de57ff4f640 Component: cli --- components/cli/Makefile | 5 +++++ components/cli/docker.Makefile | 4 ++++ components/cli/dockerfiles/Dockerfile.ci | 1 + 3 files changed, 10 insertions(+) diff --git a/components/cli/Makefile b/components/cli/Makefile index d8a54239b6..2ddc4063e5 100644 --- a/components/cli/Makefile +++ b/components/cli/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/components/cli/docker.Makefile b/components/cli/docker.Makefile index 66b48c4036..ee03ce0fe5 100644 --- a/components/cli/docker.Makefile +++ b/components/cli/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/components/cli/dockerfiles/Dockerfile.ci b/components/cli/dockerfiles/Dockerfile.ci index 52b3644ab1..29918badab 100644 --- a/components/cli/dockerfiles/Dockerfile.ci +++ b/components/cli/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