-
Notifications
You must be signed in to change notification settings - Fork 898
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 possible spec failure due to array ordering #18009
Fix possible spec failure due to array ordering #18009
Conversation
Introduced in bf66236
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
Although, it was introduced by the way strings with numbers are sorted and bf66236 just exposed that...
Ah. I see. Because "Zone 10" is sorted before "Zone 9" ... Is the array from the method supposed to be sorted? Should that be part of the test? I'm sure we could come up with another way to fix spec so that we continue to test that aspect of the method as well ... |
I'm not sure, maybe @kbrock knows? |
The method sorts the messages by zone name, so match_array isn't really testing all of the functionality. If we explicitly name the zones then we can be sure that the ordering is what we expect.
Checked commits carbonin/manageiq@c9aba72~...e78ff10 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Okay, pushed another commit for ordering that actually makes the spec closer to the original by creating the zones with the names they had before @bdunne 's change. That should make the ordering consistent. |
Merged for now since it's the same as it used to be (and removes the random test failures). It would still be good to know if it's supposed to be sorted or if the string sorting is good enough and we can switch to |
Oh, yeah, forgot to actually link the line that does the sorting. It's definitely supposed to be sorted by zone name. |
ugh. late to the game - this looks great |
Turned out this test doesn't exist in Gaprindashvili, removing |
Introduced in bf66236
Example failure: https://travis-ci.org/ManageIQ/manageiq/jobs/431577113
Backport status will be the same as #17987