-
Notifications
You must be signed in to change notification settings - Fork 356
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 test errors with :container_label_tag_mapping factory #2788
Conversation
ManageIQ/manageiq#16501 added validation that ContainerLabelTagMapping has a Tag, appropriately named, and with a read_only Classification. The UI has created mappings satisfying all this, but this test didnt. Switch to recently added factory that ensures such Tag & Classification.
I have no problem with this, but does this mean that the |
I like this one better, more simpler change. |
I think that quite lately @skateman was adding a basic factory for every model. |
Checked commit cben@0dcf2a1 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
I also had to add:
To be able to run the individual spec. |
Excellent question. The problem is that the mapping model "supports" 2 use cases:
To test both kinds, the core container_label_tag_mapping_spec still uses the base :container_label_tag_mapping factory (all these uses specify a separately created Perhaps it's also possible to merge both into one factory, and specific-value tests will simply override the tag, I'll think about it. |
@martinpovolny should I include this ApplicationHelper line in this PR? |
@cben : we discussed shortly with @NickLaMuro on the gitter and the inclusion should be probably done for all the view specs possibly in I think it can wait for another PR. We shoud get master back to green first. |
tl;dr; we should merge this as is. Seems to do the trick. My "can we delete it" comment was more something to ponder, not something that has to be done with this effort. I am cool with merging this as is, and we can address the Factory clean up at a later time. I just figured using it at all at this point would just not work now that the validation has been added, but I might be wrong (I admit to not fully groking the change that caused this bug in the first place). |
tl;dr of my above explanation: presently there are tests in core that successfully use the base factory, but they all specify a separately created |
Ah! That was the missing piece for me. Fair enough, and further emphasizes that we will "fix this later". |
Fix test errors with :container_label_tag_mapping factory (cherry picked from commit 612e4ca)
Gaprindashvili backport details:
|
Alternative to ManageIQ/manageiq#16517
ManageIQ/manageiq#16501 added validation that ContainerLabelTagMapping has a Tag, appropriately named, and with a read_only Classification.
The UI has always created mappings satisfying all this (it's just now core started depending on these assumptions).
But this test didn't create Tag & Classification, only a ContainerLabelTagMapping, which no longer works:
https://travis-ci.org/ManageIQ/manageiq-ui-classic/jobs/305345808#L2351-L2381
=> Switch to recently added factory that ensures such Tag & Classification.
@miq-bot add-label test, gaprindashvili/yes
ManageIQ/manageiq#16501 is gaprindashvili/backported, and broke manageiq-ui-classic on gaprindashvili too.
@h-kataria @agrare @NickLaMuro what do you think?