Skip to content

Commit

Permalink
chore: build integration tests with -race
Browse files Browse the repository at this point in the history
Refs #3378.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
  • Loading branch information
AlekSi authored and talos-bot committed Mar 26, 2021
1 parent 9f7d67a commit d7e9f6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ ENV PLATFORM container
ENV CGO_ENABLED 1
RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type=cache,target=/.cache go test -v -race -count 1 -p 4 ${TESTPKGS}

# The integration-test target builds integration test binary.
# The integration-test targets builds integration test binary.

FROM base AS integration-test-linux-build
ARG SHA
Expand All @@ -438,8 +438,9 @@ ARG USERNAME
ARG REGISTRY
ARG VERSION_PKG="github.com/talos-systems/talos/pkg/version"
ARG IMAGES_PKGS="github.com/talos-systems/talos/pkg/images"
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -c \
-ldflags "-s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG} -X ${IMAGES_PKGS}.Username=${USERNAME} -X ${VERSION_PKG}.PkgsVersion=${PKGS} -X ${VERSION_PKG}.ExtrasVersion=${EXTRAS} -X ${IMAGES_PKGS}.Registry=${REGISTRY}" \
ENV CGO_ENABLED 1
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -v -race -c \
-ldflags "-linkmode=external -extldflags '-static' -s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG} -X ${IMAGES_PKGS}.Username=${USERNAME} -X ${VERSION_PKG}.PkgsVersion=${PKGS} -X ${VERSION_PKG}.ExtrasVersion=${EXTRAS} -X ${IMAGES_PKGS}.Registry=${REGISTRY}" \
-tags integration,integration_api,integration_cli,integration_k8s \
./internal/integration

Expand All @@ -455,7 +456,7 @@ ARG USERNAME
ARG REGISTRY
ARG VERSION_PKG="github.com/talos-systems/talos/pkg/version"
ARG IMAGES_PKGS="github.com/talos-systems/talos/pkg/images"
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 go test -c \
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 go test -v -c \
-ldflags "-s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG} -X ${IMAGES_PKGS}.Username=${USERNAME} -X ${VERSION_PKG}.PkgsVersion=${PKGS} -X ${VERSION_PKG}.ExtrasVersion=${EXTRAS} -X ${IMAGES_PKGS}.Registry=${REGISTRY}" \
-tags integration,integration_api,integration_cli,integration_k8s \
./internal/integration
Expand All @@ -476,8 +477,9 @@ ARG VERSION_PKG="github.com/talos-systems/talos/pkg/version"
ARG IMAGES_PKGS="github.com/talos-systems/talos/pkg/images"
ARG MGMT_HELPERS_PKG="github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"
ARG ARTIFACTS
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -c \
-ldflags "-s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG} -X ${VERSION_PKG}.PkgsVersion=${PKGS} -X ${VERSION_PKG}.ExtrasVersion=${EXTRAS} -X ${IMAGES_PKGS}.Username=${USERNAME} -X ${IMAGES_PKGS}.Registry=${REGISTRY} -X ${MGMT_HELPERS_PKG}.ArtifactsPath=${ARTIFACTS}" \
ENV CGO_ENABLED 1
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -v -race -c \
-ldflags "-linkmode=external -extldflags '-static' -s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG} -X ${VERSION_PKG}.PkgsVersion=${PKGS} -X ${VERSION_PKG}.ExtrasVersion=${EXTRAS} -X ${IMAGES_PKGS}.Username=${USERNAME} -X ${IMAGES_PKGS}.Registry=${REGISTRY} -X ${MGMT_HELPERS_PKG}.ArtifactsPath=${ARTIFACTS}" \
-tags integration,integration_provision \
./internal/integration

Expand Down
8 changes: 3 additions & 5 deletions internal/integration/api/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,9 @@ func (suite *LogsSuite) testStreaming(tailLines int32) {
defer close(respCh)

for {
var msg *common.Data

msg, err = logsStream.Recv()
if err != nil {
errCh <- err
msg, e := logsStream.Recv()
if e != nil {
errCh <- e

return
}
Expand Down

0 comments on commit d7e9f6d

Please sign in to comment.