[ARVADOS] updated: 736a629e16c388a5afecc97268bd7eadfd7ce3c2

Git user git at public.curoverse.com
Fri Mar 31 13:55:41 EDT 2017


Summary of changes:
 services/api/app/controllers/arvados/v1/nodes_controller.rb    |  2 +-
 .../api/test/functional/arvados/v1/nodes_controller_test.rb    | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

       via  736a629e16c388a5afecc97268bd7eadfd7ce3c2 (commit)
       via  5ee2b9600ced7db8fefe141c837a894f33a1d129 (commit)
      from  b9236fbe81426446e1b541a45e219bbe513fe8d0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 736a629e16c388a5afecc97268bd7eadfd7ce3c2
Merge: b9236fb 5ee2b96
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Mar 31 13:54:51 2017 -0400

    Merge branch '11398-nodes-items-available'
    
    refs #11398


commit 5ee2b9600ced7db8fefe141c837a894f33a1d129
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Mar 31 13:52:36 2017 -0400

    11398: Fix missing items_available in nodes#index response.

diff --git a/services/api/app/controllers/arvados/v1/nodes_controller.rb b/services/api/app/controllers/arvados/v1/nodes_controller.rb
index 023d2ff..b308c18 100644
--- a/services/api/app/controllers/arvados/v1/nodes_controller.rb
+++ b/services/api/app/controllers/arvados/v1/nodes_controller.rb
@@ -49,7 +49,7 @@ class Arvados::V1::NodesController < ApplicationController
     if @select.nil? or @select.include? 'job_uuid'
       job_uuids = @objects.map { |n| n[:job_uuid] }.compact
       assoc_jobs = readable_job_uuids(job_uuids)
-      @objects = @objects.each do |node|
+      @objects.each do |node|
         node.job_readable = assoc_jobs.include?(node[:job_uuid])
       end
     end
diff --git a/services/api/test/functional/arvados/v1/nodes_controller_test.rb b/services/api/test/functional/arvados/v1/nodes_controller_test.rb
index 428c663..b4ddd78 100644
--- a/services/api/test/functional/arvados/v1/nodes_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/nodes_controller_test.rb
@@ -17,8 +17,8 @@ class Arvados::V1::NodesControllerTest < ActionController::TestCase
     authorize_with :inactive
     get :index
     assert_response :success
-    node_items = JSON.parse(@response.body)['items']
-    assert_equal 0, node_items.size
+    assert_equal 0, json_response['items'].size
+    assert_equal 0, json_response['items_available']
   end
 
   # active user sees non-secret attributes of up and recently-up nodes
@@ -26,8 +26,9 @@ class Arvados::V1::NodesControllerTest < ActionController::TestCase
     authorize_with :active
     get :index
     assert_response :success
-    node_items = JSON.parse(@response.body)['items']
-    assert_not_equal 0, node_items.size
+    assert_operator 0, :<, json_response['items_available']
+    node_items = json_response['items']
+    assert_operator 0, :<, node_items.size
     found_busy_node = false
     node_items.each do |node|
       assert_nil node['info'].andand['ping_secret']
@@ -113,6 +114,7 @@ class Arvados::V1::NodesControllerTest < ActionController::TestCase
       authorize_with user
       get :index, {select: ['domain']}
       assert_response :success
+      assert_operator 0, :<, json_response['items_available']
     end
   end
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list