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

Fix log parsing to check for lowercase fail in status #235

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

nitisht
Copy link
Contributor

@nitisht nitisht commented Nov 20, 2017

Fixes #233

While minio/minio-go#865 updates the minio-go logs to print FAIL as status instead of fail, to avoid further issues, we should check for both values in Mint as well.

Copy link
Collaborator

@kannappanr kannappanr left a 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

Copy link
Collaborator

@ebozduman ebozduman left a 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
Copy link
Member

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.

Copy link
Contributor Author

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.

@nitisht
Copy link
Contributor Author

nitisht commented Nov 21, 2017

@kannappanr PR is updated, please check

Copy link
Collaborator

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nitisht nitisht merged commit 3e33dea into minio:master Nov 22, 2017
@nitisht nitisht deleted the minio-go-logs branch November 22, 2017 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants