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

Get the tenant user information for Host which does not have a connected provider. #6464

Merged
merged 2 commits into from Feb 15, 2016

Conversation

lfu
Copy link
Member

@lfu lfu commented Feb 1, 2016

The default user/group/tenant to start with.

https://bugzilla.redhat.com/show_bug.cgi?id=1302687

@chessbyte
Copy link
Member

@gmcculloug please review

@chessbyte
Copy link
Member

@mkanoor @gmcculloug Please review

@miq-bot
Copy link
Member

miq-bot commented Feb 11, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@lfu lfu force-pushed the default_tenant_1302687 branch 2 times, most recently from 5197ad3 to 77336c6 Compare February 11, 2016 18:58
it "has tenant from root tenant" do
host = FactoryGirl.create(:host, :ext_management_system => ems)
ems.destroy
host.reload
Copy link
Member

Choose a reason for hiding this comment

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

@lfu Is there any reason to create the host with an EMS and then delete the EMS? You should be able to just create the host and not pass any EMS and avoid the destroy and reload.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gmcculloug Was recreating the issue as reported 😄

@lfu lfu force-pushed the default_tenant_1302687 branch 2 times, most recently from e15f7e1 to b5956ca Compare February 11, 2016 21:17
@gmcculloug
Copy link
Member

@lfu We should add tests for tenant_identity on the individual model specs as well that test the two use cases, with a provider and without.

@lfu
Copy link
Member Author

lfu commented Feb 15, 2016

@gmcculloug Updated.

:miq_group_id => ems.tenant.default_miq_group.id,
:tenant_id => ems.tenant.id
}
expect(MiqAeEngine).to receive(:deliver_queue).with(hash_including(args), anything)
Copy link
Member

Choose a reason for hiding this comment

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

@lfu You do not need to test through MiqAeEngine on each model. I would expect much simpler tests that call tenant_identify with the two configurations (with provider/without provider) and validate that they returns the expected User object configuration.

@lfu
Copy link
Member Author

lfu commented Feb 15, 2016

@gmcculloug 👍

@@ -213,4 +213,30 @@
expect(result).to be_falsey
end
end

context "#tenant_identity" do
# admin user is needed to process Events
Copy link
Member

Choose a reason for hiding this comment

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

@lfu This comment does not apply anymore and should be removed. Same with the other tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gmcculloug User admin is still needed for these classes.

Copy link
Member

Choose a reason for hiding this comment

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

Correct, but it is not being used "to process events". I do not think the comment line is needed anymore as the use of admin in the tests below is clear.

Copy link
Member

Choose a reason for hiding this comment

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

To clarify, I am not saying get rid of admin, I am saying the comment is no longer needed.

@miq-bot
Copy link
Member

miq-bot commented Feb 15, 2016

Checked commits lfu/manageiq@67a0795~...d36f26a with ruby 2.2.3, rubocop 0.34.2, and haml-lint 0.13.0
7 files checked, 0 offenses detected
Everything looks good. 🍪

gmcculloug added a commit that referenced this pull request Feb 15, 2016
Get the tenant user information for Host which does not have a connected provider.
@gmcculloug gmcculloug merged commit 6e4a01c into ManageIQ:master Feb 15, 2016
@gmcculloug gmcculloug added this to the Sprint 36 Ending Feb 16, 2016 milestone Feb 15, 2016
durandom pushed a commit to durandom/manageiq that referenced this pull request Feb 29, 2016
Get the tenant user information for Host which does not have a connected provider.

Manually merged [Refactor MiqAeEvent#automate_user_ids ManageIQ#6201](ManageIQ#6201).

Clean cherry-pick [Remove the call to User#groups_include? which has been removed. ManageIQ#6610](ManageIQ#6610).

Manually merged [Get the tenant user information for Host which does not have a connected provider. ManageIQ#6464](ManageIQ#6464).

https://bugzilla.redhat.com/show_bug.cgi?id=1308748

See merge request !796
@lfu lfu deleted the default_tenant_1302687 branch May 23, 2016 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants