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 output comparison for cmd tests #110

Merged
merged 1 commit into from
Aug 17, 2016

Conversation

surajssd
Copy link
Member

Now check on true as comparison output, then PASS, if anything else just fail on it. This avoids all the
false positives.

Now check on true as comparison output, then PASS,
if anything else just fail on it. This avoids all the
false positives.
@@ -69,8 +69,8 @@ function convert::match_output() {

match=$(jq --argfile a $TEMP_STDOUT --argfile b $expected_output -n 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b')

if [ "$match" = false ]; then FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; return 1;
else SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0; fi
if [ "$match" = true ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

Default to check if the output is true, everything else will act as fail!

@kadel
Copy link
Member

kadel commented Aug 17, 2016

LGTM

@kadel kadel added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 17, 2016
@surajssd
Copy link
Member Author

Merging. Thanks @kadel for review.

@surajssd surajssd merged commit cc9531a into kubernetes:master Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. review needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants