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

vendor: upgrade gofakes3 to v0.0.11 #472

Merged
merged 6 commits into from
Jul 29, 2022
Merged
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
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ LDFLAGS=-ldflags "-X=github.com/peak/s5cmd/version.Version=$(VERSION) -X=github.
build:
@go build ${GCFLAGS} ${LDFLAGS} -mod=vendor .

RACE_FLAG := -race
TEST_TYPE:=test_with_race
ifeq ($(OS),Windows_NT)
RACE_FLAG =
TEST_TYPE=test_without_race
endif

.PHONY: test
test:
@go test -mod=vendor -count=1 ${RACE_FLAG} ./...
test: $(TEST_TYPE)

.PHONY: test_with_race
test_with_race:
@S5CMD_BUILD_BINARY_WITHOUT_RACE_FLAG=0 go test -mod=vendor -count=1 -race ./...

.PHONY: test_without_race
test_without_race:
@S5CMD_BUILD_BINARY_WITHOUT_RACE_FLAG=1 go test -mod=vendor -count=1 ./...

.PHONY: check
check: vet staticcheck unparam check-fmt
Expand Down
3 changes: 3 additions & 0 deletions e2e/main_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package e2e

import (
"flag"
"os"
"testing"
)

func TestMain(m *testing.M) {
flag.Parse()

cleanup := goBuildS5cmd()
code := m.Run()
cleanup()
Expand Down
19 changes: 17 additions & 2 deletions e2e/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ import (
"gotest.tools/v3/icmd"
)

const (
// Don't use "race" flag in the build arguments.
testDisableRaceFlagKey = "S5CMD_BUILD_BINARY_WITHOUT_RACE_FLAG"
testDisableRaceFlagVal = "1"
)

var (
defaultAccessKeyID = "s5cmd-test-access-key-id"
defaultSecretAccessKey = "s5cmd-test-secret-access-key"
Expand Down Expand Up @@ -210,14 +216,23 @@ func goBuildS5cmd() func() {
workdir = filepath.Dir(workdir)

var args []string
if runtime.GOOS == "windows" {

if os.Getenv(testDisableRaceFlagKey) == testDisableRaceFlagVal {
/*
disable '-race' flag because CI fails with below error.
1. disable '-race' flag because CI fails with below error.

==2688==ERROR: ThreadSanitizer failed to allocate 0x000001000000
(16777216) bytes at 0x040140000000 (error code: 1455)

Ref: https://github.com/golang/go/issues/22553

2. Some distributions default to buildmode pie which is incompatible with race flag.

Ref: Alpine Linux: "All userland binaries are compiled as Position
Independent Executables (PIE)..." https://www.alpinelinux.org/about/

Ref 2: "-buildmode=pie not supported when -race is enabled"
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/work/init.go;l=245;drc=eaf21256545ae04a35fa070763faa6eb2098591d
*/
args = []string{"build", "-mod=vendor", "-o", s5cmdPath}
} else {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/go-cmp v0.4.0
github.com/hashicorp/go-multierror v1.0.0
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/igungor/gofakes3 v0.0.10
github.com/igungor/gofakes3 v0.0.11
github.com/karrick/godirwalk v1.15.3
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/kr/pretty v0.2.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/igungor/gofakes3 v0.0.10 h1:/sGbnHRjqYyK3iRQ8jOFZQhsxTMOYLCk7+CVN3FPYF4=
github.com/igungor/gofakes3 v0.0.10/go.mod h1:id+2y7yvTVoN1HW6VOtnfSqFt4EAfH5piVL4p9JsmQc=
github.com/igungor/gofakes3 v0.0.11 h1:KqVnxdhlrc5LQYUBifexI/E0X7V5CUonTmvfujkmKao=
github.com/igungor/gofakes3 v0.0.11/go.mod h1:id+2y7yvTVoN1HW6VOtnfSqFt4EAfH5piVL4p9JsmQc=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
Expand Down
3 changes: 2 additions & 1 deletion vendor/github.com/igungor/gofakes3/gofakes3.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ github.com/hashicorp/errwrap
github.com/hashicorp/go-multierror
# github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/iancoleman/strcase
# github.com/igungor/gofakes3 v0.0.10
# github.com/igungor/gofakes3 v0.0.11
github.com/igungor/gofakes3
github.com/igungor/gofakes3/backend/s3bolt
github.com/igungor/gofakes3/backend/s3mem
Expand Down