[ARVADOS] updated: abc22e2b430a57787adaf9b665cff1214b0d87fc
git at public.curoverse.com
git at public.curoverse.com
Mon Jun 2 18:00:00 EDT 2014
Summary of changes:
.../controllers/arvados/v1/job_tasks_controller.rb | 1 +
.../app/controllers/arvados/v1/users_controller.rb | 2 +
.../test/integration/serialized_encoding_test.rb | 62 +++++++++++++++-------
3 files changed, 46 insertions(+), 19 deletions(-)
via abc22e2b430a57787adaf9b665cff1214b0d87fc (commit)
from 0558601e48e0440887ae597a64c314676bb1e138 (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 abc22e2b430a57787adaf9b665cff1214b0d87fc
Author: Brett Smith <brett at curoverse.com>
Date: Mon Jun 2 17:26:50 2014 -0400
2893: API server accepts all serialized parameters as JSON.
This commit takes the bugfix that was applied in 135f306e, and ensures
it's applied to all serialized attributes.
diff --git a/services/api/app/controllers/arvados/v1/job_tasks_controller.rb b/services/api/app/controllers/arvados/v1/job_tasks_controller.rb
index d291624..434550c 100644
--- a/services/api/app/controllers/arvados/v1/job_tasks_controller.rb
+++ b/services/api/app/controllers/arvados/v1/job_tasks_controller.rb
@@ -1,2 +1,3 @@
class Arvados::V1::JobTasksController < ApplicationController
+ accept_attribute_as_json :parameters, Hash
end
diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index c2a32f0..7311deb 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -1,4 +1,6 @@
class Arvados::V1::UsersController < ApplicationController
+ accept_attribute_as_json :prefs, Hash
+
skip_before_filter :find_object_by_uuid, only:
[:activate, :event_stream, :current, :system, :setup]
skip_before_filter :render_404_if_no_object, only:
diff --git a/services/api/test/integration/serialized_encoding_test.rb b/services/api/test/integration/serialized_encoding_test.rb
index 10b9435..ed30fdb 100644
--- a/services/api/test/integration/serialized_encoding_test.rb
+++ b/services/api/test/integration/serialized_encoding_test.rb
@@ -1,27 +1,51 @@
require 'test_helper'
+load 'test/functional/arvados/v1/git_setup.rb'
class SerializedEncodingTest < ActionDispatch::IntegrationTest
+ include GitSetup
+
fixtures :all
- test "store json-encoded link with properties hash" do
- post "/arvados/v1/links", {
- :link => {
- :link_class => 'test',
- :name => 'test',
- :properties => {:foo => :bar}
- }.to_json,
- :format => :json
- }, auth(:active)
- assert_response :success
- end
+ {
+ api_client_authorization: {scopes: []},
+
+ human: {properties: {eye_color: 'gray'}},
+
+ job: {
+ repository: 'foo',
+ runtime_constraints: {docker_image: 'arvados/jobs'},
+ script: 'hash',
+ script_version: 'master',
+ script_parameters: {pattern: 'foobar'},
+ tasks_summary: {todo: 0},
+ },
+
+ job_task: {parameters: {pattern: 'foo'}},
+
+ link: {link_class: 'test', name: 'test', properties: {foo: :bar}},
+
+ node: {info: {uptime: 1234}},
+
+ pipeline_instance: {
+ components: {"job1" => {parameters: {pattern: "xyzzy"}}},
+ components_summary: {todo: 0},
+ properties: {test: true},
+ },
+
+ pipeline_template: {
+ components: {"job1" => {parameters: {pattern: "xyzzy"}}},
+ },
+
+ specimen: {properties: {eye_color: 'meringue'}},
+
+ trait: {properties: {eye_color: 'brown'}},
- test "store json-encoded pipeline instance with components_summary hash" do
- post "/arvados/v1/pipeline_instances", {
- :pipeline_instance => {
- :components_summary => {:todo => 0}
- }.to_json,
- :format => :json
- }, auth(:active)
- assert_response :success
+ user: {prefs: {cookies: 'thin mint'}},
+ }.each_pair do |resource, postdata|
+ test "create json-encoded #{resource.to_s}" do
+ post("/arvados/v1/#{resource.to_s.pluralize}",
+ {resource => postdata.to_json}, auth(:admin_trustedclient))
+ assert_response :success
+ end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list