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

Add two new types to MW server factories #16478

Merged
merged 1 commit into from
Nov 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spec/factories/middleware_servers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@
:class => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer',
:parent => :middleware_server do
end

factory :hawkular_middleware_server_wildfly,
:aliases => ['app/models/manageiq/providers/hawkular/middleware_manager/middleware_server_wildfly'],
:class => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly',
:parent => :middleware_server do
end

factory :hawkular_middleware_server_eap,
Copy link
Member

Choose a reason for hiding this comment

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

If I am not wrong, you can move those three inherited factories within the middleware_server factory and then remove the parent => :middleware_server attribute from each child factory definition.

Here a bit of more context:
https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#inheritance

Do you think it worth to change it?

Copy link
Member

Choose a reason for hiding this comment

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

@xeviknal I think the way it is done here in the PR is the same as the rest of miq does, so imo it is not worth to change it for consistency reasons. but I'd like to hear what @agrare thinks :)

Copy link
Member

Choose a reason for hiding this comment

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

@abonas is right we (rightly or wrongly) follow this pattern, e.g. see the orchestration_stack factory https://github.com/ManageIQ/manageiq/blob/master/spec/factories/orchestration_stack.rb
👍 on this for consistency

:aliases => ['app/models/manageiq/providers/hawkular/middleware_manager/middleware_server_eap'],
:class => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap',
:parent => :hawkular_middleware_server_wildfly do
end
end