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 tag to container_label_tag_mapping factory #16517

Closed

Conversation

agrare
Copy link
Member

@agrare agrare commented Nov 21, 2017

ContainerLabelTagMapping assumes it belongs_to a tag so add this to the
factory.

Introduced by #16501

ContainerLabelTagMapping assumes it belongs_to a tag so add this to the
factory.
@agrare agrare requested a review from NickLaMuro November 21, 2017 17:50
@agrare agrare added the test label Nov 21, 2017
Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

Looks good. Confirmed it gets rid of the undefined method name' for nil:NilClasserror from theFactory`.

@agrare
Copy link
Member Author

agrare commented Nov 21, 2017

cc @Fryguy

@miq-bot
Copy link
Member

miq-bot commented Nov 21, 2017

Checked commit agrare@e0e2cb4 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@NickLaMuro
Copy link
Member

@agrare can you link to #16501 in the description?

@cben
Copy link
Contributor

cben commented Nov 21, 2017

Thanks for the fix 🤕
I'm not sure about managed_kubernetes_tag because current implementation expects tag with (1) such name (2) linked to Classification that is read_only — and this only ensures (1). That's what I added tag_mapping_with_category for.

I'm going to look for prettier alternatives but 👍 to merge this first.

@miq-bot add-label gaprindashvili/yes
#16501 is gaprindashvili/backported, and made manageiq-ui-classic red on gaprindashvili too.

@cben
Copy link
Contributor

cben commented Nov 21, 2017

OK turns out using the new tag_mapping_with_category factory in the UI test fixes it:
ManageIQ/manageiq-ui-classic#2788
What do you think?

UPDATE: that was merged, fixed ui master & gaprindashvili

@agrare
Copy link
Member Author

agrare commented Nov 21, 2017

@cben that looks good, does it make sense to have a base container_label_tag_mapping factory that doesn't have a tag? Should we add just a FactoryGirl.create(:tag) given that anyone using this factory will fail due to not checking if the tag is nil?

@cben
Copy link
Contributor

cben commented Nov 22, 2017 via email

@agrare
Copy link
Member Author

agrare commented Nov 22, 2017

This base factory is now only useful if you provide a separately created
:tag, and we have tests that do exactly this.

Ah okay this is what I was missing.

@agrare agrare closed this Nov 22, 2017
@agrare agrare deleted the fix_container_label_tag_mapping_factory branch November 22, 2017 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants