Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Use gotestsum in system tests #6230

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions systest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22 as build
FROM golang:1.22 AS build
RUN set -ex \
&& apt-get update --fix-missing \
&& apt-get install -qy --no-install-recommends \
Expand All @@ -22,14 +22,25 @@ COPY . .

RUN --mount=type=cache,id=build,target=/root/.cache/go-build go test -failfast -v -c -o ./build/tests.test ./systest/tests/

FROM ubuntu:22.04
ENV CGO_ENABLED=0
RUN --mount=type=cache,id=build,target=/root/.cache/go-build go build -o ./build/test2json -ldflags="-s -w" cmd/test2json

ENV GOBIN=/bin
RUN --mount=type=cache,id=build,target=/root/.cache/go-build go install gotest.tools/[email protected]

FROM ubuntu:22.04 AS runtime
RUN set -ex \
&& apt-get update --fix-missing \
&& apt-get install -qy --no-install-recommends \
ocl-icd-libopencl1 clinfo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get update --fix-missing \
&& apt-get install -qy --no-install-recommends \
ocl-icd-libopencl1 clinfo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /src/build/tests.test /bin/tests
COPY --from=build /src/build/test2json /bin/
COPY --from=build /bin/gotestsum /bin/
COPY --from=build /src/build/libpost.so /bin/
COPY --from=build /src/build/post-service /bin/
ENV LD_LIBRARY_PATH="/bin/"

ENV GOVERSION=1.22
ENV GOTESTSUM_FORMAT=standard-quiet
5 changes: 3 additions & 2 deletions systest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ ifeq ($(configname),$(test_job_name))
run_deps = config
endif

command := tests -test.v -test.count=$(count) -test.timeout=60m -test.run=$(test_name) -test.parallel=$(clusters) \
command := gotestsum --raw-command -- test2json -t -p systest \
/bin/tests -test.v -test.count=$(count) -test.timeout=60m -test.run=$(test_name) -test.parallel=$(clusters) \
-test.failfast=$(failfast) -clusters=$(clusters) -level=$(level) -configname=$(configname)

.PHONY: docker
Expand Down Expand Up @@ -78,7 +79,7 @@ config: template

.PHONY: gomplate
gomplate:
@go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@v4.0.0-pre-1
@go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@v4.1.0

# Using bash to invoke ./wait_for_job.sh script to avoid problems on Mac
# where /bin/bash is an old bash
Expand Down
Loading