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
Handle "Not implemented" error codes in functional test #838
Conversation
functional_tests.go
Outdated
if strings.Contains(err.Error(), NotImplemented) { | ||
ignoredLog(function, args, startTime, err.Error()).Info() | ||
return | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block
functional_tests.go
Outdated
if strings.Contains(err.Error(), NotImplemented) { | ||
ignoredLog(function, args, startTime, err.Error()).Info() | ||
return | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block
functional_tests.go
Outdated
if strings.Contains(err.Error(), NotImplemented) { | ||
ignoredLog(function, args, startTime, err.Error()).Info() | ||
return | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block
functional_tests.go
Outdated
@@ -62,6 +62,7 @@ const ( | |||
secretKey = "SECRET_KEY" | |||
enableHTTPS = "ENABLE_HTTPS" | |||
) | |||
const NotImplemented = "A header you provided implies functionality that is not implemented" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported const NotImplemented should have comment or be unexported
b07b9e7
to
d322dca
Compare
LGTM |
functional_tests.go
Outdated
@@ -62,6 +62,7 @@ const ( | |||
secretKey = "SECRET_KEY" | |||
enableHTTPS = "ENABLE_HTTPS" | |||
) | |||
const notImplemented = "A header you provided implies functionality that is not implemented" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to look the string we can simply look for the error code.
functional_tests.go
Outdated
@@ -4478,6 +4479,10 @@ func testComposeMultipleSources(c *minio.Client) { | |||
} | |||
err = c.ComposeObject(dst, srcs) | |||
if err != nil { | |||
if strings.Contains(err.Error(), notImplemented) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert this into a function lets like
isErrNotImplemented()
func isErrNotImplemented(err error) bool {
errResp := ToErrorResponse(err)
return errResp.Code != "NotImplemented"
}
9fd2d9d
to
5a8146b
Compare
functional_tests.go
Outdated
@@ -158,6 +158,11 @@ func cleanupBucket(bucketName string, c *minio.Client) error { | |||
return err | |||
} | |||
|
|||
func isErrNotImplemented(err error) bool { | |||
errResp := minio.ToErrorResponse(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be written in even one liner..
func isErrNotImplemented(err error) bool {
return minio.ToErrorResponse(err).Code != "NotImplemented"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Check for the error message "Not Implemented" in ComposeObject API call. If it is seen, log NA for the test and log the error, but continue with the test. Fixes minio#834
5a8146b
to
e2bd1cb
Compare
Check for the error message "Not Implemented" in ComposeObject
API call. If it is seen, log NA for the test and log the error, but continue
with the test.
Fixes #834