-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix log parsing to check for lowercase fail in status #235
Conversation
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 check is wrong. This needs to be changed to
if [ "$jq_rv" -ne 0 ] || [ -z "$status" ] || ([ "$status" != "FAIL" ] && [ "$status" != "fail" ]); then
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.
LGTM after applying Kannappan's comment.
mint.sh
Outdated
@@ -78,7 +78,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" ]; then | |||
if [ "$jq_rv" -ne 0 ] || [ -z "$status" ] || [ "$status" != "FAIL" ] && [ "$status" != "fail" ]; then |
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.
Why do we need to support lowercase "fail"
? We decided to status to be a enum value than any string.
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.
I understand each language SDK should log the status field as an enum with only three values FAIL
, PASS
or NA
. Few SDKs are not yet doing that (example: https://github.com/minio/mint/blob/master/run/core/aws-sdk-go/quick-tests.go#L92).
While we need to fix those SDKs, Mint should be defensive in checking these values so further such problems (status case not matching) do not report false positives.
225771f
to
8a70088
Compare
@kannappanr PR is updated, please check |
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.
LGTM
Fixes #233
While minio/minio-go#865 updates the minio-go logs to print
FAIL
as status instead offail
, to avoid further issues, we should check for both values in Mint as well.