[ARVADOS] updated: 2d5ef50536851f8d190675a3bd74ee7567713ee0
Git user
git at public.curoverse.com
Tue Jun 14 13:27:12 EDT 2016
Summary of changes:
apps/workbench/Gemfile.lock | 2 +-
.../controllers/container_requests_controller.rb | 5 +++
apps/workbench/app/models/container_request.rb | 4 --
apps/workbench/app/models/container_work_unit.rb | 2 +-
.../app/views/projects/_show_dashboard.html.erb | 7 ++--
.../test/integration/application_layout_test.rb | 44 ++++++++++++++++++++--
build/run-build-packages-one-target.sh | 3 ++
build/run-build-packages.sh | 34 ++++++++++-------
doc/_includes/_install_ruby_and_bundler.liquid | 4 +-
.../install-shell-server.html.textile.liquid | 2 +-
doc/sdk/cli/install.html.textile.liquid | 4 +-
doc/sdk/ruby/index.html.textile.liquid | 4 +-
services/api/app/models/container_request.rb | 9 +++++
services/api/test/fixtures/containers.yml | 2 +
services/api/test/unit/container_request_test.rb | 11 ++++++
15 files changed, 103 insertions(+), 34 deletions(-)
via 2d5ef50536851f8d190675a3bd74ee7567713ee0 (commit)
via e4c30dbf271df0633efce61c630a29c89bc43bff (commit)
via ce7d731ac808245bd44d1999001a1e9de8f0e4db (commit)
via 0fa28b7feceb285f5d7148e26f42729692115b73 (commit)
via 04349db8d176f4a305368ad5abc551586acd24a1 (commit)
via 4ad0992515fd02eedcb11d3c52445e12e1ffa7a7 (commit)
via 4d697d3c92cb903ca24b7ce2f30573b2aa52e9a1 (commit)
via 2bf563e0e007fc4252c7a7c4db06f3c775b72320 (commit)
via 5ce935688c2bac3d4ff779db5659366722f0ff54 (commit)
from b3b64d046641ccc39e4f4d6fab85a8b831732d51 (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 2d5ef50536851f8d190675a3bd74ee7567713ee0
Author: radhika <radhika at curoverse.com>
Date: Tue Jun 14 13:26:21 2016 -0400
9372: test cancel button for jobs and container_requests.
diff --git a/apps/workbench/app/controllers/container_requests_controller.rb b/apps/workbench/app/controllers/container_requests_controller.rb
index ea26801..4a32cd8 100644
--- a/apps/workbench/app/controllers/container_requests_controller.rb
+++ b/apps/workbench/app/controllers/container_requests_controller.rb
@@ -5,5 +5,10 @@ class ContainerRequestsController < ApplicationController
def cancel
@object.update_attributes! priority: 0
+ if params[:return_to]
+ redirect_to params[:return_to]
+ else
+ redirect_to @object
+ end
end
end
diff --git a/apps/workbench/app/models/container_request.rb b/apps/workbench/app/models/container_request.rb
index b41cec9..765300b 100644
--- a/apps/workbench/app/models/container_request.rb
+++ b/apps/workbench/app/models/container_request.rb
@@ -1,8 +1,4 @@
class ContainerRequest < ArvadosBase
- def cancel
- arvados_api_client.api "container_requests/#{self.uuid}/", "cancel", {}
- end
-
def work_unit(label=nil)
ContainerWorkUnit.new(self, label)
end
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index 9796ef8..2fe1ff0 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -45,7 +45,7 @@ class ContainerWorkUnit < ProxyWorkUnit
end
def can_cancel?
- @proxied.is_a?(ContainerRequest) && state_label.in?(["Queued", "Locked", "Running"])
+ @proxied.is_a?(ContainerRequest) && state_label.in?(["Queued", "Locked", "Running"]) && priority > 0
end
def container_uuid
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 12b3ef2..8c394b1 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -1,9 +1,10 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default" style="min-height: 10.5em">
- <div class="panel-heading"><span class="panel-title">Recent pipelines and processes</span>
+ <div class="panel-heading">
+ <span class="panel-title">Recent pipelines and processes</span>
<% if current_user.andand.is_active %>
- <span class="pull-right">
+ <span class="pull-right recent-processes-actions">
<span>
<%= link_to(
choose_pipeline_templates_path(
@@ -109,7 +110,7 @@
<% nodes = Node.all %>
<div class="panel panel-default" style="min-height: 10.5em">
<div class="panel-heading"><span class="panel-title">Compute node status</span>
- <span class="pull-right">
+ <span class="pull-right compute-node-actions">
<% if current_user.andand.is_admin %>
<span>
<%= link_to nodes_path, class: 'btn btn-default btn-xs' do %>
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 2d101f9..02dc06c 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -250,21 +250,57 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
visit page_with_token(token)
assert_text 'Recent pipelines and processes' # seeing dashboard now
+ within('.recent-processes-actions') do
+ assert page.has_link?('Run a pipeline')
+ assert page.has_link?('All pipelines')
+ end
+
within('.recent-processes') do
- page.has_button? 'Run a pipeline'
- page.has_link? 'All pipelines'
assert_text 'zzzzz-d1hrv-partdonepipelin'
assert_text 'zzzzz-d1hrv-twodonepipeline'
assert_text 'zzzzz-dz642-runningcontainr'
assert_text 'zzzzz-dz642-runningcontain2'
end
+ within('.compute-node-actions') do
+ if is_admin
+ assert page.has_link?('All nodes')
+ else
+ assert page.has_no_link?('All nodes')
+ end
+ assert page.has_link? 'All jobs'
+ end
+
within('.compute-node-summary-pane') do
- page.has_link?('All nodes') if is_admin
- page.has_link? 'All jobs'
click_link 'Details'
assert_text 'compute0'
end
end
end
+
+ [
+ ['jobs', 'running_job_with_components', true],
+ ['pipeline_instances', 'components_is_jobspec', false],
+ ['containers', 'running', false],
+ ['container_requests', 'running', true],
+ ].each do |type, fixture, cancelable|
+ test "cancel button for #{type}/#{fixture}" do
+ if cancelable
+ need_selenium 'to cancel'
+ end
+
+ obj = api_fixture(type)[fixture]
+ visit page_with_token "active", "/#{type}/#{obj['uuid']}"
+
+ assert_text 'created_at'
+ if cancelable
+ assert page.has_button?('Cancel'), 'No Cancel button'
+ click_button 'Cancel'
+ wait_for_ajax
+ assert page.has_no_button?('Cancel'), 'Cancel button not expected after clicking'
+ else
+ assert page.has_no_button?('Cancel'), 'Cancel button not expected'
+ end
+ end
+ end
end
diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index 8e2e95c..c250d40 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -30,6 +30,7 @@ running:
runtime_constraints:
ram: 12000000000
vcpus: 4
+ auth_uuid: zzzzz-gj3su-077z32aux8dg2s1
running-older:
uuid: zzzzz-dz642-runningcontain2
commit e4c30dbf271df0633efce61c630a29c89bc43bff
Merge: b3b64d0 ce7d731
Author: radhika <radhika at curoverse.com>
Date: Tue Jun 14 10:15:17 2016 -0400
Merge branch 'master' into 9372-container-display
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list