Skip to content

Commit

Permalink
Partial backport of #114 from agrare/fix_failing_spec_on_missing_zone
Browse files Browse the repository at this point in the history
Fix specs failing on a missing zone

Stubbing MiqServer.my_zone to return a dummy string was affecting the zone
with which events were added to MiqQueue, which broke now that MiqQueue
requires a real zone (ManageIQ/manageiq#17987).
  • Loading branch information
Ladas authored and cben committed Nov 1, 2018
1 parent d6d8754 commit 6876d2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 8 additions & 0 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FactoryGirl.define do
factory :ems_openshift_with_zone, :parent => :ems_openshift do
zone do
_guid, _server, zone = EvmSpecHelper.create_guid_miq_server_zone
zone
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hostname = 'host.example.com'
token = 'theToken'
FactoryGirl.create(
:ems_openshift,
:ems_openshift_with_zone,
:name => 'OpenShiftProvider',
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand All @@ -20,10 +20,6 @@
)
end

before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
end

it "instantiate a template with parameters and object labels" do
param = FactoryGirl.create(:container_template_parameter,
:name => 'VAR',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
let(:images_managed_by_openshift_count) { 32 } # only images from /oapi/v1/images

before(:each) do
allow(MiqServer).to receive(:my_zone).and_return("default")
# env vars for easier VCR recording, see test_objects_record.sh
hostname = ENV["OPENSHIFT_MASTER_HOST"] || "host.example.com"
token = ENV["OPENSHIFT_MANAGEMENT_ADMIN_TOKEN"] || "theToken"

@ems = FactoryGirl.create(
:ems_openshift,
:ems_openshift_with_zone,
:name => "OpenShiftProvider",
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
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_openshift,
:ems_openshift_with_zone,
:name => 'OpenshiftProvider',
:connection_configurations => [{:endpoint => {:role => :default,
:hostname => hostname,
Expand Down

0 comments on commit 6876d2b

Please sign in to comment.