From: Tom Clegg Date: Sun, 20 Apr 2014 02:50:54 +0000 (-0400) Subject: Permit a job to update its output and log attributes even if those X-Git-Tag: 1.1.0~2702 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/8d6efcbfb559e377a8f21873b736390035bc44ed Permit a job to update its output and log attributes even if those collections have not yet been registered with apiserver. --- diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb index 0b2247bc21..61aa7dc6e5 100644 --- a/services/api/app/models/job.rb +++ b/services/api/app/models/job.rb @@ -71,7 +71,7 @@ class Job < ArvadosModel end def skip_uuid_read_permission_check - super + %w(cancelled_by_client_uuid) + super + %w(cancelled_by_client_uuid output log) end def ensure_script_version_is_commit diff --git a/services/api/test/fixtures/jobs.yml b/services/api/test/fixtures/jobs.yml index 81e8cb3b1e..427982859c 100644 --- a/services/api/test/fixtures/jobs.yml +++ b/services/api/test/fixtures/jobs.yml @@ -145,4 +145,23 @@ nondeterminisic_job_run: input: fa7aeb5140e2848d39b416daeef4ffc5+45 an_integer: "1" success: true - nondeterministic: true \ No newline at end of file + nondeterministic: true + +nearly_finished_job: + uuid: zzzzz-8i9sb-2gx6rz0pjl033w3 + owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz + repository: arvados + script: doesnotexist + script_version: 309e25a64fe994867db8459543af372f850e25b9 + script_parameters: + input: b519d9cb706a29fc7ea24dbea2f05851+249025 + started_at: <%= 3.minute.ago.to_s(:db) %> + finished_at: ~ + running: true + success: ~ + tasks_summary: + failed: 0 + todo: 0 + running: 1 + done: 0 + runtime_constraints: {} 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 9904c833c8..398c8671f8 100644 --- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb +++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb @@ -235,5 +235,20 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase assert_response 422 end + test "finish a job" do + authorize_with :active + put :update, { + id: jobs(:nearly_finished_job).uuid, + job: { + output_uuid: '551392cc37a317abf865b95f66f4ef94+101', + log: '9215de2a951a721f5f156bc08cf63ad7+93', + tasks_summary: {done: 1, running: 0, todo: 0, failed: 0}, + success: true, + running: false, + finished_at: Time.now.to_s + } + } + assert_response :success + end end