1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class JobsApiTest < ActionDispatch::IntegrationTest
11 post "/arvados/v1/jobs/#{jobs(:running).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
12 assert_response :success
13 assert_equal "arvados#job", json_response['kind']
14 assert_not_nil json_response['cancelled_at']
17 test "cancel someone else's visible job" do
18 post "/arvados/v1/jobs/#{jobs(:runningbarbaz).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:spectator).api_token}"}
22 test "cancel someone else's invisible job" do
23 post "/arvados/v1/jobs/#{jobs(:running).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:spectator).api_token}"}
27 test "task qsequence values automatically increase monotonically" do
28 post_args = ["/arvados/v1/job_tasks",
30 job_uuid: jobs(:running).uuid,
35 (1..3).each do |task_num|
38 assert_response :success
39 qsequence = json_response["qsequence"]
40 assert_not_nil(qsequence, "task not assigned qsequence")
41 assert_operator(qsequence, :>, last_qsequence,
42 "qsequence did not increase between tasks")
43 last_qsequence = qsequence