-
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 mc logging and exit on first failure #159
Conversation
PR #139 is pulling functional test of |
@balamurugana we need to release |
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.
Value for error is missing double quotes
function log_failure() {
function=$(python -c 'import sys,json; print(json.dumps(sys.stdin.read()))' <<<"$2")
printf '{"name": "mc", "duration": "%d", "function": %s, "status": "FAIL", "error": %s}\n' "$1" "$function" "$3"
}
Within test_mirror_list_objects function, around line 362
if [ $rv -eq 0 ]; then
if diff -bB <(ls "$MINT_DATA_DIR") <(./mc ls --json "${SERVER_ALIAS}/${bucket_name}" | jq -r .key ) > /dev/null; then
function="delete_bucket"
out=$(delete_bucket "$bucket_name")
rv=$?
else
rv=1
fi
fi
I see that the diff check is failing in my case. You will have to add sort to both the ls and mc command output and also redirect the output to /dev/null
Something like this
if diff -bB <(ls "$MINT_DATA_DIR" | sort) <(./mc ls --json "${SERVER_ALIAS}/${bucket_name}" | jq -r .key | sort ) > /dev/null; then
Also, I see that the buckets and objects are getting deleted only in the case of failure. Since, every test is creating a bucket, it is important to properly cleanup the buckets and objects.
47f46f5
to
e19299a
Compare
updated the PR @kannappanr |
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.
Similar to AWSCLI, we will modify the function name and args in a different PR. Otherwise LGTM
is travis expected to fail? |
Shellcheck generates a warning on ls and sort in the following line of code
this can be replaced by find like this
|
e19299a
to
1891800
Compare
Updated the PR @kannappanr @deekoder |
1891800
to
12ff742
Compare
Fixes #154