-
Notifications
You must be signed in to change notification settings - Fork 115
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 useless asserts in installer tests #14099
Conversation
trigger: test-robottelo |
@rmynar Can you please take a look at the PRT failures? |
trigger: test-robottelo |
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.
Some minor recommendations
accessibility_check = target_sat.execute(command).stdout.split('\r\n') | ||
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_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.
If you're just checking for specific substrings, you likely don't need to bother splitting the output into a list.
accessibility_check = target_sat.execute(command).stdout.split('\r\n') | |
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_check | |
accessibility_check = target_sat.execute(command).stdout | |
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_check |
accessibility_check = target_sat.execute(command).stdout.split('\r\n') | ||
assert 'HTTP/1.1 200 OK' not in accessibility_check | ||
assert 'HTTP/2 200 ' not in accessibility_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.
Same recommendation here
accessibility_check = target_sat.execute(command).stdout.split('\r\n') | |
assert 'HTTP/1.1 200 OK' not in accessibility_check | |
assert 'HTTP/2 200 ' not in accessibility_check | |
accessibility_check = target_sat.execute(command).stdout | |
assert 'HTTP/1.1 200 OK' not in accessibility_check | |
assert 'HTTP/2 200 ' not in accessibility_check |
accessibility_check = capsule_configured.execute(command).stdout.split('\r\n') | ||
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_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.
You get the idea
accessibility_check = capsule_configured.execute(command).stdout.split('\r\n') | |
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_check | |
accessibility_check = capsule_configured.execute(command).stdout | |
assert 'HTTP/1.1 200 OK' in accessibility_check or 'HTTP/2 200 ' in accessibility_check |
accessibility_check = capsule_configured.execute(command).stdout.split('\r\n') | ||
assert 'HTTP/1.1 200 OK' not in accessibility_check | ||
assert 'HTTP/2 200 ' not in accessibility_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.
Same
accessibility_check = capsule_configured.execute(command).stdout.split('\r\n') | |
assert 'HTTP/1.1 200 OK' not in accessibility_check | |
assert 'HTTP/2 200 ' not in accessibility_check | |
accessibility_check = capsule_configured.execute(command).stdout | |
assert 'HTTP/1.1 200 OK' not in accessibility_check | |
assert 'HTTP/2 200 ' not in accessibility_check |
trigger: test-robottelo |
PRT Result
|
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 agree with Jacob, otherwise LGTM
I just wanted to fix the logical error in assertion, but you're right that the split was useless. Hopefully it looks better now |
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.
ACK, thanks for the adjustment!
fix useless asserts (cherry picked from commit 44ee8bf)
fix useless asserts (cherry picked from commit 44ee8bf)
fix useless asserts (cherry picked from commit 44ee8bf)
Fix useless asserts in installer tests (#14099) fix useless asserts (cherry picked from commit 44ee8bf) Co-authored-by: rmynar <[email protected]>
Fix useless asserts in installer tests (#14099) fix useless asserts (cherry picked from commit 44ee8bf) Co-authored-by: rmynar <[email protected]>
Fix useless asserts in installer tests (#14099) fix useless asserts (cherry picked from commit 44ee8bf) Co-authored-by: rmynar <[email protected]>
fix useless asserts
Fixing assertions that were always True and therefore useless.
Note:
bool("any string with non-zero length")
is True,True or False
is True