Skip to content

Commit

Permalink
Fix Refresher Specs failing on missing zone
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Sep 17, 2018
1 parent 378f918 commit 4676d2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# instantiated at the end, for both classical and graph refresh
shared_examples "kubernetes refresher VCR tests" do
before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
auth = AuthToken.new(:name => "test", :auth_key => "valid-token")
@ems = FactoryGirl.create(:ems_kubernetes, :hostname => "10.35.0.169",
@ems = FactoryGirl.create(:ems_kubernetes_with_zone, :hostname => "10.35.0.169",
:ipaddress => "10.35.0.169", :port => 6443,
:authentications => [auth])
# NOTE: the following :uid_ems should match (downcased) the kubernetes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# instantiated at the end
shared_examples "openshift refresher VCR targeted refresh tests" do
before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
hostname = 'host.example.com'
token = 'theToken'
hawkular_hostname = 'host.example.com'

@ems = FactoryGirl.create(
:ems_kubernetes,
:ems_kubernetes_with_zone,
:name => 'KubernetesProvider',
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@

it "Deletes the monitoring manager when container manager is removed the prometheus_alerts endpoint" do
ems = FactoryGirl.create(
:ems_kubernetes,
:ems_kubernetes_with_zone,
:endpoints => [
FactoryGirl.build(:endpoint, :role => 'default', :hostname => 'host2'),
FactoryGirl.build(:endpoint, :role => 'prometheus_alerts', :hostname => 'host2')
Expand All @@ -243,7 +243,6 @@
expect(ems.monitoring_manager).not_to be_nil
expect(ems.monitoring_manager.parent_manager).to eq(ems)

allow(MiqServer).to receive(:my_zone).and_return("default")
ems.endpoints = [FactoryGirl.build(:endpoint, :role => 'default', :hostname => 'host3')]
queue_item = MiqQueue.find_by(:method_name => 'destroy')
expect(queue_item).not_to be_nil
Expand Down Expand Up @@ -306,7 +305,7 @@

it "Deletes the virtualization manager when container manager is removed the kubevirt endpoint" do
ems = FactoryGirl.create(
:ems_kubernetes,
:ems_kubernetes_with_zone,
:endpoints => [
FactoryGirl.build(:endpoint, :role => 'default', :hostname => 'host'),
FactoryGirl.build(:endpoint, :role => 'kubevirt', :hostname => 'host')
Expand All @@ -315,7 +314,6 @@
expect(ems.infra_manager).not_to be_nil
expect(ems.infra_manager.parent_manager).to eq(ems)

allow(MiqServer).to receive(:my_zone).and_return("default")
ems.endpoints = [FactoryGirl.build(:endpoint, :role => 'default', :hostname => 'host')]
queue_item = MiqQueue.find_by(:method_name => 'destroy')
expect(queue_item).not_to be_nil
Expand Down

0 comments on commit 4676d2c

Please sign in to comment.