1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class Arvados::V1::PipelineInstancesControllerTest < ActionController::TestCase
9 test 'create pipeline with components copied from template' do
10 authorize_with :active
13 pipeline_template_uuid: pipeline_templates(:two_part).uuid
16 assert_response :success
17 assert_equal(pipeline_templates(:two_part).components.to_json,
18 assigns(:object).components.to_json)
21 test 'create pipeline with no template' do
22 authorize_with :active
28 assert_response :success
29 assert_equal({}, assigns(:object).components)
36 test "cancel a pipeline instance with cascade=#{cascade}" do
37 authorize_with :active
38 pi_uuid = pipeline_instances(:job_child_pipeline_with_components_at_level_2).uuid
40 post :cancel, {id: pi_uuid, cascade: cascade}
41 assert_response :success
43 pi = PipelineInstance.where(uuid: pi_uuid).first
44 assert_equal "Paused", pi.state
46 children = Job.where(uuid: ['zzzzz-8i9sb-job1atlevel3noc', 'zzzzz-8i9sb-job2atlevel3noc'])
47 children.each do |child|
48 assert_equal ("Cancelled" == child.state), cascade