Closed chris1984 closed 3 months ago
@ShimShtein let me know what i'm missing with the test, it's still asserting 2 instead of 3. or we can talk about it tomorrow when we sync up.
@chris1984 you are not missing anything, actually you are adding too much here: https://github.com/theforeman/foreman_rh_cloud/pull/885/files#diff-1db2fc1b0779ffd29ad0788780a64b71490bad277d33887ef72e1283465b09d5R42
If you create a record in foreman, and create it in the Insights request mock, it means that it's not a missing host. This is why you have only two missing hosts, even though you have added a new one to the Insights request. If you want to test for creation of a new missing host record, you need to make sure it exists only in Insights, and not in Foreman.
@ShimShtein updated, thanks for the pointer
Merged, thanks @chris1984 !
What are the changes introduced in this pull request?
ip_addresses
isnil
What are the testing steps for this pull request?
ip_addresses = nil
at https://github.com/theforeman/foreman_rh_cloud/blob/v10/lib/inventory_sync/async/inventory_hosts_sync.rb#L70foreman-rake rh_cloud_inventory:sync
and watch theproduction.log
fail withundefined method take_while for nil:NilClass (NoMethodError)