@object = ContainerRequest.new
- @object.command = src.command
+ # If "no reuse" requested, pass the correct argument to arvados-cwl-runner command.
+ if params[:no_reuse] and src.command[0] == 'arvados-cwl-runner'
+ command = src.command - ['--enable-reuse']
+ command.insert(1, '--disable-reuse')
+ else
+ command = src.command
+ end
+
+ @object.command = command
@object.container_image = src.container_image
@object.cwd = src.cwd
@object.description = src.description
<% if @object.state == 'Final' %>
+ <%= link_to(copy_container_request_path('id' => @object.uuid, 'no_reuse' => true),
+ class: 'btn btn-sm btn-primary',
+ data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it without container reuse',
+ method: :post,
+ ) do %>
+ <i class="fa fa-fw fa-play"></i> Re-run without reuse
+ <% end %>
<%= link_to(copy_container_request_path('id' => @object.uuid),
class: 'btn btn-sm btn-primary',
- title: 'Re-run',
data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it',
method: :post,
) do %>
assert_select 'Download the log', false
end
- test "completed container request offers re-run option" do
+ test "completed container request offers re-run options" do
use_token 'active'
uuid = api_fixture('container_requests')['completed']['uuid']
assert_response :success
assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy\""
+ assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy?no_reuse=true\""
end
test "container request copy" do