-
Notifications
You must be signed in to change notification settings - Fork 992
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
Fixes #22796 - fact importing telemetry #5296
Conversation
Issues: #22796 |
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.
@lzap Thanks, this is much cleane! The failing tests are only failing because in test/models/host_test.rb
you need to also mock the class_name_humanized
method for the stubbed parsers in setup_host_with_nic_parser
and setup_host_with_ipmi_parser
.
👍 to merge after that if tests are green
end | ||
telemetry_increment_counter(:importer_facts_count_interfaces, changed_count, type: parser.class_name_humanized) |
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.
This line is unexpected in some tests that use a mocked parser, could you check that out?
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.
Don't understand this one?
Thanks rebased. |
ef32038
to
981b47b
Compare
test/models/host_test.rb
Outdated
[host, parser] | ||
end | ||
|
||
def setup_host_with_ipmi_parser(ipmi_attributes) | ||
host = FactoryBot.create(:host, :hostgroup => FactoryBot.create(:hostgroup)) | ||
hash = ipmi_attributes.with_indifferent_access | ||
primary = host.primary_interface | ||
parser = stub(:ipmi_interface => hash, :interfaces => {}, :suggested_primary_interface => [ primary.identifier, {:macaddress => primary.mac, :ipaddress => primary.ip} ]) | ||
parser = stub(:class_name_humanized => 'TestParser', :ipmi_interface => hash, :interfaces => {}, :suggested_primary_interface => [ primary.identifier, {:macaddress => primary.mac, :ipaddress => primary.ip} ]) |
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.
Space inside square brackets detected.
test/models/host_test.rb
Outdated
@@ -1370,7 +1370,7 @@ def teardown | |||
|
|||
test "#set_interfaces handles no interfaces" do | |||
host = FactoryBot.create(:host, :hostgroup => FactoryBot.create(:hostgroup)) | |||
parser = stub(:ipmi_interface => {}, :interfaces => {}, :suggested_primary_interface => [ nil, nil ]) | |||
parser = stub(:class_name_humanized => 'TestParser', :ipmi_interface => {}, :interfaces => {}, :suggested_primary_interface => [ nil, nil ]) |
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.
Space inside square brackets detected.
[test foreman] I'll fix the hound spacing issues if tests pass |
Tests pass, the failure in MySQL is being addressed on https://github.com/theforeman/foreman/pull/5325/files |
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.
Doh, I forgot 'develop' is now protected..
remote: error: GH006: Protected branch update failed for refs/heads/develop.
remote: error: At least 1 approving review is required by reviewers with write access.
Please just address the hound issues & I'll merge right away. Thanks !
Can successfully list the facts telemetry
|
981b47b
to
883bd81
Compare
Rebased. |
merged, díky @lzap! |
SSIA
This patch is an example on how to add telemetry.
It removes publication of Rails notifications in the importer, it was
unused and we now have a better way of publishing that into telemetry
stack.