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
Rendering status for servers and deployments in middleware topology #1461
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,29 +13,34 @@ | |
subject { middleware_topology_service.build_topology } | ||
|
||
let(:ems_hawkular) { FactoryGirl.create(:ems_hawkular) } | ||
let(:mw_server) do | ||
let!(:mw_server) do | ||
FactoryGirl.create(:hawkular_middleware_server, | ||
:name => 'Local', | ||
:feed => '70c798a0-6985-4f8a-a525-012d8d28e8a3', | ||
:ems_ref => long_id_0, | ||
:nativeid => 'Local~~', | ||
:ext_management_system => ems_hawkular) | ||
:ext_management_system => ems_hawkular, | ||
:properties => { 'Calculated Server State' => 'running' }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a test checking what happens when the status property is not set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't. I will add it. It should render as "unknown" (gray circle). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, it is down in the file. |
||
end | ||
|
||
it "topology contains the expected structure and content" do | ||
before do | ||
allow(middleware_topology_service).to receive(:retrieve_providers).and_return([ems_hawkular]) | ||
end | ||
|
||
it "topology contains the expected structure and content" do | ||
mw_deployment1 = MiddlewareDeployment.create(:ext_management_system => ems_hawkular, | ||
:middleware_server => mw_server, | ||
:ems_ref => long_id_2, | ||
:name => "hawkular-wildfly-agent-download.war", | ||
:nativeid => long_id_4) | ||
:nativeid => long_id_4, | ||
:status => 'Enabled') | ||
|
||
mw_deployment2 = MiddlewareDeployment.create(:ext_management_system => ems_hawkular, | ||
:middleware_server => mw_server, | ||
:ems_ref => long_id_1, | ||
:name => "hawkular-command-gateway-war.war", | ||
:nativeid => long_id_5) | ||
:nativeid => long_id_5, | ||
:status => 'Disabled') | ||
|
||
mw_datasource = MiddlewareDatasource.create(:ext_management_system => ems_hawkular, | ||
:middleware_server => mw_server, | ||
|
@@ -60,7 +65,7 @@ | |
|
||
expect(subject[:items]).to include( | ||
"MiddlewareServer" + mw_server.compressed_id.to_s => {:name => mw_server.name, | ||
:status => "Unknown", | ||
:status => "Running", | ||
:kind => "MiddlewareServer", | ||
:display_kind => "MiddlewareServer", | ||
:miq_id => mw_server.id, | ||
|
@@ -69,15 +74,15 @@ | |
|
||
expect(subject[:items]).to include( | ||
"MiddlewareDeployment" + mw_deployment1.compressed_id.to_s => {:name => mw_deployment1.name, | ||
:status => "Unknown", | ||
:status => "Enabled", | ||
:kind => "MiddlewareDeployment", | ||
:display_kind => "MiddlewareDeploymentWar", | ||
:miq_id => mw_deployment1.id} | ||
) | ||
|
||
expect(subject[:items]).to include( | ||
"MiddlewareDeployment" + mw_deployment2.compressed_id.to_s => {:name => mw_deployment2.name, | ||
:status => "Unknown", | ||
:status => "Disabled", | ||
:kind => "MiddlewareDeployment", | ||
:display_kind => "MiddlewareDeploymentWar", | ||
:miq_id => mw_deployment2.id} | ||
|
@@ -113,5 +118,19 @@ | |
:target => "MiddlewareMessaging" + mw_messaging.compressed_id.to_s} | ||
) | ||
end | ||
|
||
it "topology renders unknown status if server state is not set" do | ||
mw_server.properties = nil | ||
mw_server.save! | ||
|
||
expect(subject[:items]).to include( | ||
"MiddlewareServer" + mw_server.compressed_id.to_s => {:name => mw_server.name, | ||
:status => "Unknown", | ||
:kind => "MiddlewareServer", | ||
:display_kind => "MiddlewareServer", | ||
:miq_id => mw_server.id, | ||
:icon => match(/vendor-wildfly/)} | ||
) | ||
end | ||
end | ||
end |
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.
it's a nit, but I would set different ids to different vars in the test. from a consistency perspective only.