[ARVADOS] created: 73dbf5bf94b162e5e9ed74cb60f17ee2c7018059
Git user
git at public.curoverse.com
Thu Mar 16 14:19:40 EDT 2017
at 73dbf5bf94b162e5e9ed74cb60f17ee2c7018059 (commit)
commit 73dbf5bf94b162e5e9ed74cb60f17ee2c7018059
Author: Lucas Di Pentima <lucas at curoverse.com>
Date: Thu Mar 16 15:18:23 2017 -0300
11014: Check for PipelineIndex#index API to exist for rendering the compute node status pane on the Dashboard.
Added related test.
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index ab6eb16..4f01f9d 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -140,6 +140,7 @@
</div>
<div class="col-md-6">
+ <% if PipelineInstance.api_exists?(:index) %>
<% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
<div class="panel panel-default" style="min-height: 10.5em">
<div class="panel-heading"><span class="panel-title">Compute node status</span>
@@ -173,6 +174,7 @@
</div>
</div>
</div>
+ <% end %>
<% if Rails.configuration.show_recent_collections_on_dashboard %>
<div class="panel panel-default">
<div class="panel-heading"><span class="panel-title">Recent collections</span>
diff --git a/apps/workbench/test/controllers/disabled_api_test.rb b/apps/workbench/test/controllers/disabled_api_test.rb
index 47276c0..55c7b24 100644
--- a/apps/workbench/test/controllers/disabled_api_test.rb
+++ b/apps/workbench/test/controllers/disabled_api_test.rb
@@ -15,6 +15,17 @@ class DisabledApiTest < ActionController::TestCase
assert_includes @response.body, "Run a process"
end
+ test "dashboard compute node status when pipeline_instance index API is disabled" do
+ @controller = ProjectsController.new
+
+ dd = ArvadosApiClient.new_or_current.discovery.deep_dup
+ dd[:resources][:pipeline_instances][:methods].delete(:index)
+ ArvadosApiClient.any_instance.stubs(:discovery).returns(dd)
+
+ get :index, {}, session_for(:active)
+ assert_not_includes @response.body, "compute-node-summary-pane"
+ end
+
[
[:jobs, JobsController.new],
[:job_tasks, JobTasksController.new],
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list