Skip to content

Commit

Permalink
pkg/files/docker: enable race detector by default
Browse files Browse the repository at this point in the history
Race detector is especially important in integration tests, because they
often end up testing many things against the services, which are more
likely to find out weird hidden races.

Change-Id: I6ee356a3e8d609d422ac7a7a0cd0cd14a9cbf099
  • Loading branch information
egonelbre committed May 13, 2024
1 parent 0a4c360 commit 4fbac05
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ build-app:
test:
RUN go install github.com/mfridman/tparse@36f80740879e24ba6695649290a240c5908ffcbb
RUN apt-get update && apt-get install -y jq
RUN go install storj.io/storj/cmd/[email protected]
RUN go install storj.io/storj/cmd/[email protected]
RUN go install storj.io/storj/cmd/[email protected]
RUN go install storj.io/edge/cmd/[email protected]
RUN go install storj.io/edge/cmd/[email protected]
RUN go install storj.io/edge/cmd/[email protected]
RUN go install -race storj.io/storj/cmd/[email protected]
RUN go install -race storj.io/storj/cmd/[email protected]
RUN go install -race storj.io/storj/cmd/[email protected]
RUN go install -race storj.io/edge/cmd/[email protected]
RUN go install -race storj.io/edge/cmd/[email protected]
RUN go install -race storj.io/edge/cmd/[email protected]
RUN mkdir build
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ storj-up local-bin -s linux_amd64 satellite-core satellite-admin satellite-api
You will also need to cross-compile to Linux when you update your local satellite, e.g.

```
GOOS=linux GOARCH=amd64 go install ./cmd/satellite
GOOS=linux GOARCH=amd64 go install -race ./cmd/satellite
```

Then if you are not currently running the containers, run
Expand Down
2 changes: 1 addition & 1 deletion pkg/files/docker/edge.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY --chown=storj ${PATH} .
FROM --platform=$TARGETPLATFORM ${TYPE} AS binaries
RUN --mount=type=cache,target=/var/lib/storj/go/pkg/mod,mode=777,uid=1000 \
--mount=type=cache,target=/var/lib/storj/.cache/go-build,mode=777,uid=1000 \
go install ./cmd/...
go install -race ./cmd/...

FROM img.dev.storj.io/storjup/base:20240509-1 AS final
COPY --from=binaries /var/lib/storj/go/bin /var/lib/storj/go/bin
Expand Down
2 changes: 1 addition & 1 deletion pkg/files/docker/storj.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN if [ -z "$SKIP_FRONTEND_BUILD" ] ; then env env GO111MODULE=on GOOS=js GOARC

RUN --mount=type=cache,target=/var/lib/storj/go/pkg/mod,mode=777,uid=1000 \
--mount=type=cache,target=/var/lib/storj/.cache/go-build,mode=777,uid=1000 \
go install ./cmd/... \
go install -race ./cmd/... \
&& go install -ldflags \
"-X storj.io/common/version.buildRelease=false \
-X storj.io/common/version.buildVersion=v0.0.0 \
Expand Down
4 changes: 2 additions & 2 deletions pkg/files/docker/storjscan.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ COPY --chown=storj ${PATH} .
FROM --platform=$TARGETPLATFORM ${TYPE} AS binaries
RUN --mount=type=cache,target=/var/lib/storj/go/pkg/mod,mode=777,uid=1000 \
--mount=type=cache,target=/var/lib/storj/.cache/go-build,mode=777,uid=1000 \
go install ./cmd/...
RUN go install github.com/elek/cethacea@main
go install -race ./cmd/...
RUN go install -race github.com/elek/cethacea@main

FROM img.dev.storj.io/storjup/base:20240509-1 AS final
COPY --from=binaries /var/lib/storj/go/bin /var/lib/storj/go/bin
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -exuo pipefail
cd $(dirname "${BASH_SOURCE[0]}")/..
mkdir -p build
go test -json ./... | tee build/tests.json | jq '. | select(.Action == "fail")' -cr
go test -race -json ./... | tee build/tests.json | jq '. | select(.Action == "fail")' -cr

0 comments on commit 4fbac05

Please sign in to comment.