Use gotest.tools/gotestsum binary to run unit and e2e tests and simplify the output.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki 2019-01-24 17:53:42 +01:00
parent 2344627564
commit 3bd3996f72
4 changed files with 14 additions and 3 deletions

View File

@ -16,6 +16,11 @@ RUN go get -d github.com/mjibson/esc && \
go build -v -o /usr/bin/esc . && \ go build -v -o /usr/bin/esc . && \
rm -rf /go/src/* /go/pkg/* /go/bin/* rm -rf /go/src/* /go/pkg/* /go/bin/*
ARG GOTESTSUM_VERSION=0.3.2
RUN curl -Ls https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz -o gotestsum.tar.gz && \
tar -xf gotestsum.tar.gz gotestsum -C /usr/bin && \
rm gotestsum.tar.gz
ENV CGO_ENABLED=0 \ ENV CGO_ENABLED=0 \
PATH=$PATH:/go/src/github.com/docker/cli/build \ PATH=$PATH:/go/src/github.com/docker/cli/build \
DISABLE_WARN_OUTSIDE_CONTAINER=1 DISABLE_WARN_OUTSIDE_CONTAINER=1

View File

@ -24,6 +24,12 @@ ARG NOTARY_VERSION=v0.6.1
RUN curl -Ls https://github.com/theupdateframework/notary/releases/download/${NOTARY_VERSION}/notary-Linux-amd64 -o /usr/local/bin/notary \ RUN curl -Ls https://github.com/theupdateframework/notary/releases/download/${NOTARY_VERSION}/notary-Linux-amd64 -o /usr/local/bin/notary \
&& chmod +x /usr/local/bin/notary && chmod +x /usr/local/bin/notary
ARG GOTESTSUM_VERSION=0.3.2
RUN curl -Ls https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz -o gotestsum.tar.gz \
&& tar -xf gotestsum.tar.gz gotestsum \
&& mv gotestsum /usr/local/bin/gotestsum \
&& rm gotestsum.tar.gz
ENV CGO_ENABLED=0 \ ENV CGO_ENABLED=0 \
DISABLE_WARN_OUTSIDE_CONTAINER=1 \ DISABLE_WARN_OUTSIDE_CONTAINER=1 \
PATH=/go/src/github.com/docker/cli/build:$PATH PATH=/go/src/github.com/docker/cli/build:$PATH

View File

@ -68,9 +68,9 @@ function runtests {
TEST_REMOTE_DAEMON="${REMOTE_DAEMON-}" \ TEST_REMOTE_DAEMON="${REMOTE_DAEMON-}" \
TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \ TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \
GOPATH="$GOPATH" \ GOPATH="$GOPATH" \
PATH="$PWD/build/:/usr/bin" \ PATH="$PWD/build/:/usr/bin:/usr/local/bin:/usr/local/go/bin" \
DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-amd64" \ DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-amd64" \
"$(which go)" test -v ./e2e/... ${TESTFLAGS-} "$(which gotestsum)" -- ./e2e/... ${TESTFLAGS-}
} }
export unique_id="${E2E_UNIQUE_ID:-cliendtoendsuite}" export unique_id="${E2E_UNIQUE_ID:-cliendtoendsuite}"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu -o pipefail set -eu -o pipefail
go test -v "$@" gotestsum -- "$@"