[ARVADOS] updated: a9c59725cc4df5d505bcef220ef4fccb2e61228d

git at public.curoverse.com git at public.curoverse.com
Thu Aug 21 17:11:22 EDT 2014


Summary of changes:
 .../test/functional/collections_controller_test.rb      |  4 ++--
 apps/workbench/test/integration/collections_test.rb     |  7 +++----
 apps/workbench/test/integration/projects_test.rb        |  2 +-
 apps/workbench/test/unit/arvados_resource_list_test.rb  | 17 +----------------
 apps/workbench/test/unit/group_test.rb                  | 11 +----------
 services/api/app/controllers/application_controller.rb  |  1 +
 services/api/test/fixtures/collections.yml              |  6 +++---
 services/api/test/fixtures/links.yml                    |  2 +-
 services/api/test/fixtures/specimens.yml                |  8 +-------
 .../functional/arvados/v1/groups_controller_test.rb     | 13 -------------
 10 files changed, 14 insertions(+), 57 deletions(-)

       via  a9c59725cc4df5d505bcef220ef4fccb2e61228d (commit)
      from  5d651aff459f70c777054217203a239cbfd95706 (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 a9c59725cc4df5d505bcef220ef4fccb2e61228d
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Aug 21 17:11:19 2014 -0400

    3036: Most workbench tests pass.

diff --git a/apps/workbench/test/functional/collections_controller_test.rb b/apps/workbench/test/functional/collections_controller_test.rb
index f86c50a..8c6aeab 100644
--- a/apps/workbench/test/functional/collections_controller_test.rb
+++ b/apps/workbench/test/functional/collections_controller_test.rb
@@ -56,8 +56,8 @@ class CollectionsControllerTest < ActionController::TestCase
   end
 
   test "viewing a collection fetches related projects" do
-    show_collection(:foo_file, :active)
-    assert_includes(assigns(:projects).map(&:uuid),
+    show_collection({id: api_fixture('collections')["foo_file"]['portable_data_hash']}, :active)
+    assert_includes(assigns(:same_pdh).map(&:owner_uuid),
                     api_fixture('groups')['aproject']['uuid'],
                     "controller did not find linked project")
   end
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index fff5db7..ac2625a 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -3,11 +3,10 @@ require 'selenium-webdriver'
 require 'headless'
 
 class CollectionsTest < ActionDispatch::IntegrationTest
-  test "Collection page renders default name links" do
+  test "Collection page renders name" do
     uuid = api_fixture('collections')['foo_file']['uuid']
-    coll_name = api_fixture('links')['foo_collection_name_in_aproject']['name']
-    name_uuid = api_fixture('links')['foo_collection_name_in_aproject']['uuid']
-    visit page_with_token('active', "/collections/#{name_uuid}")
+    coll_name = api_fixture('collections')['foo_file']['name']
+    visit page_with_token('active', "/collections/#{uuid}")
     assert(page.has_text?(coll_name), "Collection page did not include name")
     # Now check that the page is otherwise normal, and the collection name
     # isn't only showing up in an error message.
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index b2c9d77..1207d30 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -27,7 +27,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   test 'Add a new name, then edit it, without creating a duplicate' do
     project_uuid = api_fixture('groups')['aproject']['uuid']
-    specimen_uuid = api_fixture('specimens')['owned_by_aproject_with_no_name_link']['uuid']
+    specimen_uuid = api_fixture('specimens')['owned_by_aproject_with_no_name']['uuid']
     visit page_with_token 'active', '/projects/' + project_uuid
     click_link 'Other objects'
     within '.selection-action-container' do
diff --git a/apps/workbench/test/unit/arvados_resource_list_test.rb b/apps/workbench/test/unit/arvados_resource_list_test.rb
index fa4f9c5..619c346 100644
--- a/apps/workbench/test/unit/arvados_resource_list_test.rb
+++ b/apps/workbench/test/unit/arvados_resource_list_test.rb
@@ -8,27 +8,12 @@ class ResourceListTest < ActiveSupport::TestCase
     assert_equal [], results.links_for(api_fixture('users')['active']['uuid'])
   end
 
-  test 'links_for on non-empty resource list' do
-    use_token :active
-    results = Group.find(api_fixture('groups')['aproject']['uuid']).contents(include_linked: true)
-    assert_equal [], results.links_for(api_fixture('users')['active']['uuid'])
-    assert_equal [], results.links_for(api_fixture('jobs')['running_cancelled']['uuid'])
-    assert_equal [], results.links_for(api_fixture('jobs')['running']['uuid'], 'bogus-link-class')
-    assert_equal true, results.links_for(api_fixture('jobs')['running']['uuid'], 'name').any?
-  end
-
   test 'links_for returns all link classes (simulated results)' do
     project_uuid = api_fixture('groups')['aproject']['uuid']
     specimen_uuid = api_fixture('specimens')['in_aproject']['uuid']
     api_response = {
       kind: 'arvados#specimenList',
       links: [{kind: 'arvados#link',
-                uuid: 'zzzzz-o0j2j-asdfasdfasdfas0',
-                tail_uuid: project_uuid,
-                head_uuid: specimen_uuid,
-                link_class: 'name',
-                name: 'Alice'},
-              {kind: 'arvados#link',
                 uuid: 'zzzzz-o0j2j-asdfasdfasdfas1',
                 tail_uuid: project_uuid,
                 head_uuid: specimen_uuid,
@@ -45,7 +30,7 @@ class ResourceListTest < ActiveSupport::TestCase
     }
     arl = ArvadosResourceList.new
     arl.results = ArvadosApiClient.new.unpack_api_response(api_response)
-    assert_equal(['name', 'foo', nil],
+    assert_equal(['foo', nil],
                  (arl.
                   links_for(specimen_uuid).
                   collect { |x| x.link_class }),
diff --git a/apps/workbench/test/unit/group_test.rb b/apps/workbench/test/unit/group_test.rb
index c555c4a..3f5cebc 100644
--- a/apps/workbench/test/unit/group_test.rb
+++ b/apps/workbench/test/unit/group_test.rb
@@ -5,25 +5,16 @@ class GroupTest < ActiveSupport::TestCase
     use_token :active
     oi = Group.
       find(api_fixture('groups')['asubproject']['uuid']).
-      contents(include_linked: true)
+      contents()
     assert_operator(0, :<, oi.count,
                     "Expected to find some items belonging to :active user")
     assert_operator(0, :<, oi.items_available,
                     "Expected contents response to have items_available > 0")
-    assert_operator(0, :<, oi.result_links.count,
-                    "Expected to receive name links with contents response")
     oi_uuids = oi.collect { |i| i['uuid'] }
 
     expect_uuid = api_fixture('specimens')['in_asubproject']['uuid']
     assert_includes(oi_uuids, expect_uuid,
                     "Expected '#{expect_uuid}' in asubproject's contents")
-
-    expect_uuid = api_fixture('specimens')['in_aproject_linked_from_asubproject']['uuid']
-    expect_name = api_fixture('links')['specimen_is_in_two_projects']['name']
-    assert_includes(oi_uuids, expect_uuid,
-                    "Expected '#{expect_uuid}' in asubproject's contents")
-    assert_equal(expect_name, oi.name_for(expect_uuid),
-                 "Expected name_for '#{expect_uuid}' to be '#{expect_name}'")
   end
 
   test "can select specific group columns" do
diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index c9c7879..2b52eab 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -214,6 +214,7 @@ class ApplicationController < ActionController::Base
         flat_map { |attr| api_column_map[attr] }.
         uniq.
         map { |s| "#{table_name}.#{ActiveRecord::Base.connection.quote_column_name s}" }
+      columns_list += ["#{table_name}.id"]
       @objects = @objects.select(columns_list.join(", "))
     end
     @objects = @objects.order(@orders.join ", ") if @orders.any?
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index 9dfcee3..74c8681 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -1,6 +1,6 @@
 user_agreement:
   uuid: zzzzz-4zz18-t68oksiu9m80s4y
-  portable_data_hash: b519d9cb706a29fc7ea24dbea2f05851+249025
+  portable_data_hash: b519d9cb706a29fc7ea24dbea2f05851+93
   owner_uuid: zzzzz-tpzed-000000000000000
   created_at: 2013-12-26T19:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
@@ -119,11 +119,11 @@ foo_collection_in_aproject:
   modified_at: 2014-04-21 15:37:48 -0400
   updated_at: 2014-04-21 15:37:48 -0400
   manifest_text: ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo\n"
-  name: "zzzzz-4zz18-znfnqtbbv4spc3w added sometime"
+  name: "zzzzz-4zz18-fy296fx3hot09f7 added sometime"
 
 user_agreement_in_anonymously_accessible_project:
   uuid: zzzzz-4zz18-uukreo9rbgwsujr
-  portable_data_hash: b519d9cb706a29fc7ea24dbea2f05851+249025
+  portable_data_hash: b519d9cb706a29fc7ea24dbea2f05851+93
   owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
   created_at: 2014-06-13 20:42:26 -0800
   modified_at: 2014-06-13 20:42:26 -0800
diff --git a/services/api/test/fixtures/links.yml b/services/api/test/fixtures/links.yml
index f4b67f1..c3dcacd 100644
--- a/services/api/test/fixtures/links.yml
+++ b/services/api/test/fixtures/links.yml
@@ -358,7 +358,7 @@ foo_collection_tag:
   modified_at: 2014-04-21 15:37:48 -0400
   updated_at: 2014-04-21 15:37:48 -0400
   tail_uuid: ~
-  head_uuid: zzzzz-4zz18-znfnqtbbv4spc3w
+  head_uuid: zzzzz-4zz18-fy296fx3hot09f7
   link_class: tag
   name: foo_tag
   properties: {}
diff --git a/services/api/test/fixtures/specimens.yml b/services/api/test/fixtures/specimens.yml
index 4528070..ad94cba 100644
--- a/services/api/test/fixtures/specimens.yml
+++ b/services/api/test/fixtures/specimens.yml
@@ -28,13 +28,7 @@ in_asubproject:
   created_at: 2014-04-21 15:37:48 -0400
   modified_at: 2014-04-21 15:37:48 -0400
 
-in_aproject_linked_from_asubproject:
-  uuid: zzzzz-j58dm-5gid26432uujf79
-  owner_uuid: zzzzz-j7d0g-v955i6s2oi1cbso
-  created_at: 2014-04-21 15:37:48 -0400
-  modified_at: 2014-04-21 15:37:48 -0400
-
-owned_by_aproject_with_no_name_link:
+owned_by_aproject_with_no_name:
   uuid: zzzzz-j58dm-ypsjlol9dofwijz
   owner_uuid: zzzzz-j7d0g-v955i6s2oi1cbso
   created_at: 2014-05-05 04:11:52 -0400
diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index e8ce6fd..6fa1d16 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -239,19 +239,6 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     assert_equal 0, json_response['items_available']
   end
 
-  test 'get group-owned objects without include_linked' do
-    unexpected_uuid = specimens(:in_aproject_linked_from_asubproject).uuid
-    authorize_with :active
-    get :contents, {
-      id: groups(:asubproject).uuid,
-      format: :json,
-    }
-    assert_response :success
-    uuids = json_response['items'].collect { |i| i['uuid'] }
-    assert_equal nil, uuids.index(unexpected_uuid)
-  end
-
-
   test "get all pages of group-owned objects" do
     authorize_with :active
     limit = 5

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list