-
Notifications
You must be signed in to change notification settings - Fork 63
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
Allow nil parent for tests #75
Conversation
Thanks, tested, this fixes the ui-classic Travis failures 👍 :) |
|
Checked commit moolitayer@6c91e60 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@moolitayer I was wondering if we should fix the spec to not assume as much. It now effectively calls itself for all (There's even a |
That sounds so much better. I'm not sure the factory girl alone would save us. Maybe starting with a whitelist of objects for the test? |
Maybe.. but the thing is, we do need to support making a tree node for almost all the entities in the system, because if it's visible somewhere in the ui, it's most likely in one tree or other too. I'd rather have a foolproof way of creating a realistic testing object for each of those.. We could do a blacklist, but.. I guess there's probably a plan to expose MonitoringManager in the UI as well, right? At which point we would remove it from the blacklist and be back where we are now.. |
Well it is not meant to be shown in the UI (which is why I don't feel at ease with this PR). But if all the objects in the system can be created with |
@himdel approve of this change? |
@moolitayer I thought @himdel approved here |
@moolitayer please label the PR as best you can |
Might look like the approval is only on fixing travis and not the PR. |
Retroactive 👍, fixing cross-repo Travis is crucial.
IIUC we're discussing 3 options:
IMHO (3) is best. That's generally what we write factories for, except how can test know correct factory for each class?
|
@moolitayer Any reason there's no milestone here? |
@bdunne see #72 (comment) |
there's no particular reason, just update for update sake https://github.com/ManageIQ/more_core_extensions/compare/179bf40..e5b4501 - Added Ruby 2.7 support [[ManageIQ#79](ManageIQ/more_core_extensions#79)] - Added Process#pause, Process#resume, and Process#alive? [[ManageIQ#73](ManageIQ/more_core_extensions#73)] array added * `#compact_map` - Collect non-nil results from the block array added `#tabular_sort` - Sorts an Array of Hashes by specific columns hierarchy added `#descendant_get` - Returns the descendant with a given name the two breaking changes: - **BREAKING**: Moved Object#descendant_get to Class#descendant_get [[ManageIQ#75](ManageIQ/more_core_extensions#75)] - **BREAKING**: Removed deprecated Enumerable#stable_sort_by [[ManageIQ#76](ManageIQ/more_core_extensions#76)] a minor header output change was made that hasn't been released yet to make tableize more markdown compliant see ManageIQ/linux_admin#221
there's no particular reason, just update for update sake https://github.com/ManageIQ/more_core_extensions/compare/179bf40..e5b4501 - Added Ruby 2.7 support [[ManageIQ#79](ManageIQ/more_core_extensions#79)] - Added Process#pause, Process#resume, and Process#alive? [[ManageIQ#73](ManageIQ/more_core_extensions#73)] array added * `#compact_map` - Collect non-nil results from the block array added `#tabular_sort` - Sorts an Array of Hashes by specific columns hierarchy added `#descendant_get` - Returns the descendant with a given name the two breaking changes: - **BREAKING**: Moved Object#descendant_get to Class#descendant_get [[ManageIQ#75](ManageIQ/more_core_extensions#75)] - **BREAKING**: Removed deprecated Enumerable#stable_sort_by [[ManageIQ#76](ManageIQ/more_core_extensions#76)] a minor header output change was made that hasn't been released yet to make tableize more markdown compliant see ManageIQ/linux_admin#221
there's no particular reason, just update for update sake https://github.com/ManageIQ/more_core_extensions/compare/179bf40..e5b4501 - Added Ruby 2.7 support [[ManageIQ#79](ManageIQ/more_core_extensions#79)] - Added Process#pause, Process#resume, and Process#alive? [[ManageIQ#73](ManageIQ/more_core_extensions#73)] array added * `#compact_map` - Collect non-nil results from the block array added `#tabular_sort` - Sorts an Array of Hashes by specific columns hierarchy added `#descendant_get` - Returns the descendant with a given name the two breaking changes: - **BREAKING**: Moved Object#descendant_get to Class#descendant_get [[ManageIQ#75](ManageIQ/more_core_extensions#75)] - **BREAKING**: Removed deprecated Enumerable#stable_sort_by [[ManageIQ#76](ManageIQ/more_core_extensions#76)] a minor header output change was made that hasn't been released yet to make tableize more markdown compliant see ManageIQ/linux_admin#221
Like other managers with parents, we must
allow_nil
to passmanageiq-ui-classic's
tree_node_spec.rb
creation with out a parent obeject (which should never happen in real life). Reproduce usingManageIQ::Providers::Openshift::MonitoringManager.new
(as @himdel pointed out)