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 several ext_management_system factories #14017
Conversation
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 if the tests pass :)
This seems useful!
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.
@chrisarcand can you have a look too, I'm not too familiar with FactoryGirl traits and magic
@@ -76,6 +76,28 @@ | |||
:parent => :ext_management_system do | |||
end | |||
|
|||
# Traits | |||
|
|||
trait :with_clusters do |
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.
can we make the traits local to ems?
IIUC this makes them available everywhere, but its only useful in :ems, right?
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.
@durandom done
cbada5c
to
6965d63
Compare
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.
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.
TBH I'd say you don't really need the transient count
attributes. Normally traits just provide something that you want easy examples of that you don't need a fine grain on the content for. That is, you probably don't really care about setting the exact number of clusters or storages, you just want some, so you just say :with_storages
and call it good. If a test really requires setting a certain number of storages/clusters, the test can just specifically handle that without using a general trait.
However, it's not really detrimental and you can leave them if you think it's really useful. (Note in your other PR you might as well remove the 3
count that you have in there as you aren't doing anything with different storage/cluster counts anyway)
end | ||
|
||
trait :with_storages do | ||
ignore do |
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 here.
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.
done
# Traits | ||
|
||
trait :with_clusters do | ||
ignore do |
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.
ignore
is deprecated; prefer transient
instead.
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.
done
Added several factories useful for writing specs using infra providers with storages & clusters. Also added factories for specific versions of the Red Hat infra provider.
6965d63
to
c7be891
Compare
@chrisarcand Thank you, I have fixed the occurrences of I have also fix the dependent PR to not pass the |
Checked commit matobet@c7be891 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Added several factories useful for writing specs using infra providers with
storages & clusters.
Also added factories for specific versions of the Red Hat infra provider.