Skip to content

Commit

Permalink
mint fixes for go1.14 (minio#10294)
Browse files Browse the repository at this point in the history
add go.mod to ensure that mint can be
built with go1.14.x
  • Loading branch information
harshavardhana authored Aug 20, 2020
1 parent ccd967e commit 98ca770
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mint/build/aws-sdk-go/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#

test_run_dir="$MINT_RUN_CORE_DIR/aws-sdk-go"
GO111MODULE=on go build -o "$test_run_dir/aws-sdk-go" "$test_run_dir/quick-tests.go"
(cd "$test_run_dir" && GO111MODULE=on CGO_ENABLED=0 go build)
2 changes: 1 addition & 1 deletion mint/build/healthcheck/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#

test_run_dir="$MINT_RUN_CORE_DIR/healthcheck"
GO111MODULE=on go build -o "$test_run_dir/healthcheck" "$test_run_dir/healthcheck.go"
(cd "$test_run_dir" && GO111MODULE=on CGO_ENABLED=0 go build)
5 changes: 2 additions & 3 deletions mint/build/minio-go/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ if [ -z "$MINIO_GO_VERSION" ]; then
fi

test_run_dir="$MINT_RUN_CORE_DIR/minio-go"
(git clone https://github.com/minio/minio-go && cd minio-go && git checkout --quiet "tags/$MINIO_GO_VERSION")
GO111MODULE=on CGO_ENABLED=0 go build -o "$test_run_dir/minio-go" "minio-go/functional_tests.go"
rm -rf minio-go
curl -sL -o "${test_run_dir}/main.go" "https://raw.githubusercontent.com/minio/minio-go/${MINIO_GO_VERSION}/functional_tests.go"
(cd "$test_run_dir" && GO111MODULE=on CGO_ENABLED=0 go build -o minio-go main.go)
4 changes: 2 additions & 2 deletions mint/build/minio-py/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ fi

test_run_dir="$MINT_RUN_CORE_DIR/minio-py"
pip3 install --user faker
pip3 install minio=="$MINIO_PY_VERSION"
$WGET --output-document="$test_run_dir/tests.py" "https://raw.githubusercontent.com/minio/minio-py/${MINIO_PY_VERSION}/tests/functional/tests.py"
pip3 install git+http://github.com/minio/minio-py
$WGET --output-document="$test_run_dir/tests.py" "https://raw.githubusercontent.com/minio/minio-py/master/tests/functional/tests.py"
2 changes: 1 addition & 1 deletion mint/build/security/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#

test_run_dir="$MINT_RUN_CORE_DIR/security"
GO111MODULE=on go build -o "$test_run_dir/tls-tests" "$test_run_dir/tls-tests.go"
(cd "$test_run_dir" && GO111MODULE=on CGO_ENABLED=0 go build -o tls-tests)
7 changes: 5 additions & 2 deletions mint/mint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function run_test()
fi
## Show error.log when status is empty or not "FAIL".
## This may happen when test run failed without providing logs.
if [ "$jq_rv" -ne 0 ] || [ -z "$status" ] || ([ "$status" != "FAIL" ] && [ "$status" != "fail" ]); then
if [ "$jq_rv" -ne 0 ] || [ -z "$status" ] || { [ "$status" != "FAIL" ] && [ "$status" != "fail" ]; }; then
cat "$BASE_LOG_DIR/$sdk_name/$ERROR_FILE"
else
jq . <<<"$entry"
Expand Down Expand Up @@ -157,10 +157,13 @@ function main()
sdks=( "$@" )

if [ "$#" -eq 0 ]; then
sdks=( $(ls "$TESTS_DIR") )
cd "$TESTS_DIR" || exit
sdks=(*)
cd .. || exit
fi

for sdk in "${sdks[@]}"; do
sdk=$(basename "$sdk")
run_list=( "${run_list[@]}" "$TESTS_DIR/$sdk" )
done

Expand Down
3 changes: 3 additions & 0 deletions mint/run/core/aws-sdk-go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module mint.minio.io/aws-sdk-go

go 1.14
File renamed without changes.
3 changes: 3 additions & 0 deletions mint/run/core/healthcheck/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module mint.minio.io/healthcheck

go 1.14
File renamed without changes.
3 changes: 3 additions & 0 deletions mint/run/core/minio-go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module mint.minio.io/minio-go

go 1.14
2 changes: 1 addition & 1 deletion mint/run/core/s3cmd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare FILE_1_MB_MD5SUM
declare FILE_65_MB_MD5SUM

BUCKET_NAME="s3cmd-test-bucket-$RANDOM"
S3CMD=$(which s3cmd)
S3CMD=$(command -v s3cmd)
declare -a S3CMD_CMD

function get_md5sum()
Expand Down
3 changes: 3 additions & 0 deletions mint/run/core/security/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module mint.minio.io/security

go 1.14
File renamed without changes.

0 comments on commit 98ca770

Please sign in to comment.