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

[DNM] refactored code test to not break anything #2

Conversation

AlexanderZagaynov
Copy link
Owner

@AlexanderZagaynov AlexanderZagaynov commented Feb 19, 2018

Test results description:

  • First file:
    • Within the base PR :custom_reconnect_block was added.
  • Second file:
    • Those two methods were defined in a parent class (but using the current class's values - hence there is no errors on those methods testing)
    • It was a typo before, fixed

Test results:

azagayno@azagayno:~/work/manageiq$ bundle exec rspec spec/models/manager_refresh/inventory_collection_default_spec.rb:28
** override_gem: manageiq-providers-amazon, [{:path=>"/home/azagayno/work/manageiq/plugins/manageiq-providers-amazon"}], caller: /home/azagayno/work/manageiq/bundler.d/local_plugins.rb
Run options: include {:locations=>{"./spec/models/manager_refresh/inventory_collection_default_spec.rb"=>[28]}}

Randomized with seed 15938
...F..F

Failures:

  1) ManagerRefresh::InventoryCollectionDefault refactoring it should behave like unchanged miq_templates: []
     Failure/Error: expect(new_result).to eq(old_result)
     
       expected: {:model_class=>"MiqTemplate", :association=>:miq_templates, :delete_method=>:disconnect_inv, :attribu...endor], :builder_params=>{:ems_id=>"Proc", :name=>"unknown", :location=>"unknown", :template=>true}}
            got: {:model_class=>"MiqTemplate", :association=>:miq_templates, :use_ar_object=>true, :delete_method=>:di...endor], :builder_params=>{:ems_id=>"Proc", :name=>"unknown", :location=>"unknown", :template=>true}}
     
       (compared using ==)
     
       Diff:
       @@ -2,6 +2,7 @@
        :attributes_blacklist => [:genealogy_parent],
        :batch_extra_attributes => [:power_state, :previous_state, :state_changed_on],
        :builder_params => {:ems_id=>"Proc", :name=>"unknown", :location=>"unknown", :template=>true},
       +:custom_reconnect_block => "Proc",
        :delete_method => :disconnect_inv,
        :inventory_object_attributes => [:boot_time, :connection_state, :ems_cluster, :ems_ref, :ems_ref_obj, :host, :location, :memory_limit, :memory_reserve, :name, :raw_power_state, :snapshots, :storage, :storages, :template, :type, :uid_ems, :vendor],
        :model_class => "MiqTemplate",
       
     Shared Example Group: :unchanged called from ./spec/models/manager_refresh/inventory_collection_default_spec.rb:65
     # ./spec/models/manager_refresh/inventory_collection_default_spec.rb:58:in `block (4 levels) in <top (required)>'

  2) ManagerRefresh::InventoryCollectionDefault refactoring it should behave like unchanged vms: []
     Failure/Error: expect(new_result).to eq(old_result)
     
       expected: {:model_class=>"Vm", :association=>:vms, :delete_method=>:disconnect_inv, :attributes_blacklist=>[:ge...ype, :uid_ems, :vendor], :builder_params=>{:ems_id=>"Proc", :name=>"unknown", :location=>"unknown"}}
            got: {:model_class=>"Vm", :association=>:vms, :use_ar_object=>true, :delete_method=>:disconnect_inv, :save...ype, :uid_ems, :vendor], :builder_params=>{:ems_id=>"Proc", :name=>"unknown", :location=>"unknown"}}
     
       (compared using ==)
     
       Diff:
       @@ -2,6 +2,7 @@
        :attributes_blacklist => [:genealogy_parent],
        :batch_extra_attributes => [:power_state, :previous_state, :state_changed_on],
        :builder_params => {:ems_id=>"Proc", :name=>"unknown", :location=>"unknown"},
       +:custom_reconnect_block => "Proc",
        :delete_method => :disconnect_inv,
        :inventory_object_attributes => [:boot_time, :connection_state, :cpu_limit, :cpu_reserve, :cpu_reserve_expand, :cpu_shares, :cpu_shares_level, :ems_cluster, :ems_ref, :ems_ref_obj, :host, :location, :memory_limit, :memory_reserve, :memory_reserve_expand, :memory_shares, :memory_shares_level, :name, :raw_power_state, :snapshots, :storage, :storages, :template, :type, :uid_ems, :vendor],
        :model_class => "Vm",
       
     Shared Example Group: :unchanged called from ./spec/models/manager_refresh/inventory_collection_default_spec.rb:65
     # ./spec/models/manager_refresh/inventory_collection_default_spec.rb:58:in `block (4 levels) in <top (required)>'

Finished in 0.03829 seconds (files took 7.6 seconds to load)
7 examples, 2 failures

Failed examples:

rspec ./spec/models/manager_refresh/inventory_collection_default_spec.rb[1:2:4:1] # ManagerRefresh::InventoryCollectionDefault refactoring it should behave like unchanged miq_templates: []
rspec ./spec/models/manager_refresh/inventory_collection_default_spec.rb[1:2:2:1] # ManagerRefresh::InventoryCollectionDefault refactoring it should behave like unchanged vms: []

Randomized with seed 15938
azagayno@azagayno:~/work/manageiq$ bundle exec rspec spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb 
** override_gem: manageiq-providers-amazon, [{:path=>"/home/azagayno/work/manageiq/plugins/manageiq-providers-amazon"}], caller: /home/azagayno/work/manageiq/bundler.d/local_plugins.rb

Randomized with seed 49208
F..................F.

Failures:

  1) ManagerRefresh::InventoryCollectionDefault::InfraManager refactoring should eq [:hosts, :snapshots, :vms, :storages, :custom_attributes, :guest_devices, :resource_pools, :switches,..._switches, :datacenters, :host_networks, :host_hardwares, :host_operating_systems, :snapshot_parent]
     Failure/Error: it { expect(@new_methods).to eq(@old_methods) }
     
       expected: [:hosts, :snapshots, :vms, :storages, :custom_attributes, :guest_devices, :resource_pools, :switches,..._switches, :datacenters, :host_networks, :host_hardwares, :host_operating_systems, :snapshot_parent]
            got: [:hosts, :snapshots, :storages, :custom_attributes, :guest_devices, :resource_pools, :switches, :netw..._switches, :datacenters, :host_networks, :host_hardwares, :host_operating_systems, :snapshot_parent]
     
       (compared using ==)
     
       Diff:
       
       @@ -1,13 +1,11 @@
        [:hosts,
         :snapshots,
       - :vms,
         :storages,
         :custom_attributes,
         :guest_devices,
         :resource_pools,
         :switches,
         :networks,
       - :operating_systems,
         :ems_folders,
         :ems_clusters,
         :host_storages,
       
     # ./spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb:39:in `block (3 levels) in <top (required)>'

  2) ManagerRefresh::InventoryCollectionDefault::InfraManager refactoring it should behave like unchanged snapshot_parent: []
     Failure/Error: expect(new_result).to eq(old_result)
     
       expected: {:association=>:snapshot_patent, :custom_save_block=>"Proc"}
            got: {:association=>:snapshot_parent, :custom_save_block=>"Proc"}
     
       (compared using ==)
     
       Diff:
       @@ -1,3 +1,3 @@
       -:association => :snapshot_patent,
       +:association => :snapshot_parent,
        :custom_save_block => "Proc",
       
     Shared Example Group: :unchanged called from ./spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb:42
     # ./spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb:35:in `block (4 levels) in <top (required)>'

Finished in 0.06775 seconds (files took 7.76 seconds to load)
21 examples, 2 failures

Failed examples:

rspec ./spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb:39 # ManagerRefresh::InventoryCollectionDefault::InfraManager refactoring should eq [:hosts, :snapshots, :vms, :storages, :custom_attributes, :guest_devices, :resource_pools, :switches,..._switches, :datacenters, :host_networks, :host_hardwares, :host_operating_systems, :snapshot_parent]
rspec ./spec/models/manager_refresh/inventory_collection_default/infra_manager_spec.rb[1:1:19:1] # ManagerRefresh::InventoryCollectionDefault::InfraManager refactoring it should behave like unchanged snapshot_parent: []

Randomized with seed 49208

@AlexanderZagaynov AlexanderZagaynov changed the base branch from BZ-1536406 to backups/BZ-1536406 February 20, 2018 11:44
AlexanderZagaynov pushed a commit that referenced this pull request May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant