-
Notifications
You must be signed in to change notification settings - Fork 898
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 automate specs after MulticastLogger changes #17001
Fix automate specs after MulticastLogger changes #17001
Conversation
Specs that used `stub_automate_workspace` would fail no because, previously, the calls to `resolve_automation_object`: def self.resolve_automation_object(uri, user_obj, attr = nil, options = {}, readonly = false) raise "User object not passed in" unless user_obj.kind_of?(User) uri = create_automation_object(uri, attr, options) if attr options[:uri] = uri MiqAeWorkspaceRuntime.instantiate(uri, user_obj, :readonly => readonly).tap do |ws| $miq_ae_logger.debug { ws.to_expanded_xml } end end Would trigger the `$miq_ae_logger.debug` line and just no-op, because the underlying logger would be set to info. This change allows the `double` that is instantiated in `stub_automate_workspace` to also receive `#to_expanded_xml` optionally, so that line won't cause failures.
@simaishi I added the same |
Checked commit NickLaMuro@671a346 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
…lticast-logger-fallout Fix automate specs after MulticastLogger changes (cherry picked from commit 0f50b52)
Gaprindashvili backport details:
|
So, not that anyone is going to care, but wanted to give an explanation as to why this just showed up when it did. It was indeed after #16990 was merged, but that only exposed it. Prior to even #15392 , where the For those following along at home, but need a quick refresher, the issue was with this line of code: $miq_ae_logger.debug { ws.to_expanded_xml } Specifically,
So basically what I am saying is this was always busted like this, we just never had a chance where it would bumble up because our tests were never logging in |
Specs that used
stub_automate_workspace
would fail no because, previously, the calls toresolve_automation_object
:Would trigger the
$miq_ae_logger.debug
line and just no-op, because the underlying logger would be set to info.This change allows the
double
that is instantiated instub_automate_workspace
to also receive#to_expanded_xml
optionally, so that line won't cause failures.Links
Steps for Testing/QA
This probably needs to be merged into master to allow ManageIQ/manageiq-providers-amazon#410 to pass and be a proper QA, but you can check out that branches' changes by doing the following:
And then update the manageiq spec helper by doing the following