Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Oct 12, 2020
1 parent df64615 commit 0c627a7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
14 changes: 6 additions & 8 deletions Makefile
Expand Up @@ -24,7 +24,7 @@ SDK_COMPA_PKGS=${SDK_CORE_PKGS} ${SDK_CLIENT_PKGS}
SDK_EXAMPLES_PKGS=
SDK_ALL_PKGS=${SDK_COMPA_PKGS} ${SDK_EXAMPLES_PKGS}

RUN_NONE=-run '^$$'
RUN_NONE=-run NONE
RUN_INTEG=-run '^TestInteg_'

CODEGEN_RESOURCES_PATH=$(shell pwd)/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen
Expand Down Expand Up @@ -113,7 +113,7 @@ unit-race-modules-%:
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst unit-race-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go vet ${BUILD_TAGS} --all ./..." \
"BUILD_ONLY=true go test ${BUILD_TAGS} ${RUN_NONE} ./..." \
"go test ${BUILD_TAGS} ${RUN_NONE} ./..." \
"go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./..."


Expand All @@ -123,11 +123,10 @@ unit-modules-%:
@# replaces all "_" with "/".
@#
@# e.g. unit-modules-internal_protocoltest
export BUILD_ONLY=true \
&& cd ./internal/repotools/cmd/eachmodule \
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst unit-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go vet ${BUILD_TAGS} --all ./..." \
"BUILD_ONLY=true go test ${BUILD_TAGS} ${RUN_NONE} ./..." \
"go test ${BUILD_TAGS} ${RUN_NONE} ./..." \
"go test -timeout=1m ${UNIT_TEST_TAGS} ./..."

build: build-modules-.
Expand All @@ -140,7 +139,7 @@ build-modules-%:
@# e.g. build-modules-internal_protocoltest
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst build-modules-,,$@)) ${EACHMODULE_FLAGS} \
"BUILD_ONLY=true go test ${BUILD_TAGS} ${RUN_NONE} ./..."
"go test ${BUILD_TAGS} ${RUN_NONE} ./..."

test: test-modules-.

Expand Down Expand Up @@ -209,8 +208,7 @@ bench-modules-%:
@# replaces all "_" with "/".
@#
@# e.g. bench-modules-service_dynamodb
export BUILD_ONLY=true \
&& cd ./internal/repotools/cmd/eachmodule \
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst bench-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go test -timeout=10m -bench . --benchmem ${BUILD_TAGS} ${RUN_NONE} ./..."

Expand Down
1 change: 0 additions & 1 deletion s3manager/go.mod
Expand Up @@ -3,7 +3,6 @@ module github.com/aws/aws-sdk-go-v2/s3manager
go 1.15

require (
github.com/aws/aws-sdk-go v1.35.1
github.com/aws/aws-sdk-go-v2 v0.26.0
github.com/aws/aws-sdk-go-v2/config v0.1.1
github.com/aws/aws-sdk-go-v2/service/s3 v0.26.0
Expand Down
10 changes: 0 additions & 10 deletions s3manager/go.sum
@@ -1,5 +1,3 @@
github.com/aws/aws-sdk-go v1.35.1 h1:dGBUiVpdG6Zho3taAqGJKxuhn+qIrP3OdjfrtqowDyc=
github.com/aws/aws-sdk-go v1.35.1/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.0.0-20200930084954-897dfb99530c h1:v1H0WQmb+pNOZ/xDXGT3wXn6aceSN3I2wqK0VpQM/ZM=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.0.0-20200930084954-897dfb99530c/go.mod h1:GRJ/IvA6A00/2tAw9KgMTM8as5gAlNI0FVCKBc+aRnA=
github.com/awslabs/smithy-go v0.0.0-20200930175536-2cd7f70a8c2f/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI=
Expand All @@ -8,23 +6,15 @@ github.com/awslabs/smithy-go v0.1.1 h1:v1hUSAYf3w2ClKr58C+AtwoyPVoBjWyWT8thf7/VR
github.com/awslabs/smithy-go v0.1.1/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
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=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
15 changes: 11 additions & 4 deletions s3manager/integ_shared_test.go
Expand Up @@ -5,10 +5,10 @@ package s3manager_test
import (
"context"
"crypto/md5"
"flag"
"fmt"
"io"
"os"
"strings"
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -33,9 +33,16 @@ var bucketName *string
var client *s3.Client

func TestMain(m *testing.M) {
if strings.EqualFold(os.Getenv("BUILD_ONLY"), "true") {
os.Exit(0)
}
flag.Parse()
flag.CommandLine.Visit(func(f *flag.Flag) {
if !(f.Name == "run" || f.Name == "test.run") {
return
}
value := f.Value.String()
if value == `NONE` {
os.Exit(0)
}
})

client = s3.NewFromConfig(integConfig)
bucketName = aws.String(integration.GenerateBucketName())
Expand Down
5 changes: 2 additions & 3 deletions s3manager/upload.go
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/aws-sdk-go/aws/awserr"
)

// MaxUploadParts is the maximum allowed number of parts in a multi-part upload
Expand Down Expand Up @@ -544,7 +543,7 @@ func (u *multiuploader) upload(firstBuf io.ReadSeeker, cleanup func()) (*UploadO

func (u *multiuploader) shouldContinue(part int32, nextChunkLen int, err error) (bool, error) {
if err != nil && err != io.EOF {
return false, awserr.New("ReadRequestBody", "read multipart upload data failed", err)
return false, fmt.Errorf("read multipart upload data failed, %w", err)
}

if nextChunkLen == 0 {
Expand All @@ -565,7 +564,7 @@ func (u *multiuploader) shouldContinue(part int32, nextChunkLen int, err error)
msg = fmt.Sprintf("exceeded total allowed S3 limit MaxUploadParts (%d). Adjust PartSize to fit in this limit",
MaxUploadParts)
}
return false, awserr.New("TotalPartsExceeded", msg, nil)
return false, fmt.Errorf(msg)
}

return true, err
Expand Down

0 comments on commit 0c627a7

Please sign in to comment.