[ARVADOS] updated: 9ead624f8ea10f60a6472edb2d15ac576af85515

git at public.curoverse.com git at public.curoverse.com
Thu Sep 25 14:33:02 EDT 2014


Summary of changes:
 services/api/test/fixtures/jobs.yml                | 25 ++++++++++
 .../arvados/v1/groups_controller_test.rb           | 53 ++++++++++++----------
 .../functional/arvados/v1/jobs_controller_test.rb  | 24 ++++++++--
 3 files changed, 74 insertions(+), 28 deletions(-)

       via  9ead624f8ea10f60a6472edb2d15ac576af85515 (commit)
       via  9b21fc7fa2702c8901a6b3f00db6c07fe7cb6849 (commit)
       via  142c18d8174004fc0665106cae71b6f18ba7980b (commit)
      from  081ffd25912e960854427a7c0531c6dbb78d1b4c (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 9ead624f8ea10f60a6472edb2d15ac576af85515
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 25 14:17:19 2014 -0400

    3889: split the test "get all pages of group-owned objects" into multiple tests that pull pages with offset of 5.

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 de339c9..59dcd2b 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -239,16 +239,14 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     assert_equal 0, json_response['items_available']
   end
 
-  test "get all pages of group-owned objects" do
-    authorize_with :active
-    limit = 5
-    offset = 0
-    items_available = nil
-    uuid_received = {}
-    owner_received = {}
-    while true
-      # Behaving badly here, using the same controller multiple
-      # times within a test.
+  [0, 5, 10, 15, 20].each do |offset|
+    test "get pages of group-owned objects with offset #{offset}" do
+      authorize_with :active
+      limit = 5
+      items_available = nil
+      uuid_received = {}
+      owner_received = {}
+
       @json_response = nil
       get :contents, {
         id: groups(:aproject).uuid,
@@ -257,23 +255,28 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
         format: :json,
       }
       assert_response :success
-      assert_operator(0, :<, json_response['items'].count,
-                      "items_available=#{items_available} but received 0 "\
-                      "items with offset=#{offset}")
       items_available ||= json_response['items_available']
-      assert_equal(items_available, json_response['items_available'],
-                   "items_available changed between page #{offset/limit} "\
-                   "and page #{1+offset/limit}")
-      json_response['items'].each do |item|
-        uuid = item['uuid']
-        assert_equal(nil, uuid_received[uuid],
-                     "Received '#{uuid}' again on page #{1+offset/limit}")
-        uuid_received[uuid] = true
-        owner_received[item['owner_uuid']] = true
-        offset += 1
-        assert_equal groups(:aproject).uuid, item['owner_uuid']
+      if offset >= items_available
+        assert_equal(0, json_response['items'].count,
+                      "items_available=#{items_available} but received #{json_response['items']} "\
+                      "items with offset=#{offset}")
+      else
+        assert_operator(0, :<, json_response['items'].count,
+                        "items_available=#{items_available} but received  "\
+                        "items with offset=#{offset}")
+        assert_equal(items_available, json_response['items_available'],
+                     "items_available changed between page #{offset/limit} "\
+                     "and page #{1+offset/limit}")
+        json_response['items'].each do |item|
+          uuid = item['uuid']
+          assert_equal(nil, uuid_received[uuid],
+                       "Received '#{uuid}' again on page #{1+offset/limit}")
+          uuid_received[uuid] = true
+          owner_received[item['owner_uuid']] = true
+          offset += 1
+          assert_equal groups(:aproject).uuid, item['owner_uuid']
+        end
       end
-      break if offset >= items_available
     end
   end
 

commit 9b21fc7fa2702c8901a6b3f00db6c07fe7cb6849
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 25 13:34:55 2014 -0400

    3889: add the job fixture "job_with_unnormalized_output_and_log"

diff --git a/services/api/test/fixtures/jobs.yml b/services/api/test/fixtures/jobs.yml
index e677240..017d896 100644
--- a/services/api/test/fixtures/jobs.yml
+++ b/services/api/test/fixtures/jobs.yml
@@ -212,3 +212,28 @@ queued:
   is_locked_by_uuid: ~
   tasks_summary: {}
   runtime_constraints: {}
+
+job_with_unnormalized_output_and_log:
+  uuid: zzzzz-8i9sb-abcd2bnq7jt7kon
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  cancelled_at: ~
+  cancelled_by_user_uuid: ~
+  cancelled_by_client_uuid: ~
+  script_version: 7def43a4d3f20789dda4700f703b5514cc3ed250
+  script_parameters:
+    input: 1f4b0bc7583c2a7f9102c395f4ffc5e3+45
+  created_at: <%= 4.minute.ago.to_s(:db) %>
+  started_at: <%= 3.minute.ago.to_s(:db) %>
+  finished_at: <%= 2.minute.ago.to_s(:db) %>
+  running: false
+  success: true
+  output: fa7aeb5140e2848d39b416daeef4ffc5+45+K at xyzzy
+  priority: 0
+  log: ea10d51bcf88862dbcc36eb292017dfd+45+K at xyzzy
+  is_locked_by_uuid: ~
+  tasks_summary:
+    failed: 0
+    todo: 0
+    running: 0
+    done: 1
+  runtime_constraints: {}

commit 142c18d8174004fc0665106cae71b6f18ba7980b
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 25 13:30:56 2014 -0400

    3889: split the test "normalize output and log uuids when creating job" into two tests:
    1) that creates a job with unnormalized output and log and verifies that normalization happened and
    2) that updates a job with unnormalized output and log (a fixture) with normalized output and log.

diff --git a/services/api/test/functional/arvados/v1/jobs_controller_test.rb b/services/api/test/functional/arvados/v1/jobs_controller_test.rb
index ca6112a..7541bc7 100644
--- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb
@@ -44,13 +44,31 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase
 
     # Make sure version doesn't get mangled by normalize
     assert_not_nil version.match(/^[0-9a-f]{40}$/)
+    assert_equal 'master', JSON.parse(@response.body)['supplied_script_version']
+  end
+
+  test "normalize output and log uuids when updating job" do
+    authorize_with :active
+
+    job = jobs(:job_with_unnormalized_output_and_log)
+
     put :update, {
-      id: new_job['uuid'],
+      id: job['uuid'],
       job: {
-        log: new_job['log']
+        log: job['log']
       }
     }
-    assert_equal version, JSON.parse(@response.body)['script_version']
+
+    updated_job = JSON.parse(@response.body)
+    assert_not_equal job['log'], updated_job['log']
+    assert_equal job[:log][0,job['log'].rindex('+')], updated_job['log']
+    assert_not_equal job['output'], updated_job['output']
+    assert_equal job[:output][0,job['output'].rindex('+')], updated_job['output']
+
+    # Make sure version doesn't get mangled by normalize
+    updated_version = updated_job['script_version']
+    assert_not_nil updated_version.match(/^[0-9a-f]{40}$/)
+    assert_equal job['script_version'], updated_version
   end
 
   test "cancel a running job" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list