Skip to content

Commit

Permalink
cicd: only run tests as part of go test not as part of container build.
Browse files Browse the repository at this point in the history
During the container build the tests run in an isolated environment. In order to make them pass functionality like `--add-host=host.docker.internal:host-gateway` should be used but then part of the build.

For now we just have tests run on the Ubuntu host from Github actions.
  • Loading branch information
Peter Van Bouwel committed Nov 26, 2024
1 parent b3012ee commit 2760ff3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ WORKDIR /usr/src/fakes3pp
RUN go mod download
RUN go mod tidy
ADD . /usr/src/fakes3pp/
RUN go test -coverprofile cover.out ./...
#TODO: run tests in container build after github actions build can access the testing S3 backend endpoints.
# for now we just do test coverage in another job which is a dependency of the actual build to make sure tests pass.
#RUN go test -coverprofile cover.out ./...
RUN go vet
RUN CGO_ENABLED=0 GOOS=linux go build -o main .

Expand Down

0 comments on commit 2760ff3

Please sign in to comment.