[ARVADOS] updated: 89b46374d746fe785e3ba0088f0886caa17893db
Git user
git at public.curoverse.com
Fri Sep 23 14:10:15 EDT 2016
Summary of changes:
apps/workbench/app/views/work_units/_show_log.html.erb | 8 ++++++--
.../controllers/container_requests_controller_test.rb | 17 ++++++++++++++++-
2 files changed, 22 insertions(+), 3 deletions(-)
via 89b46374d746fe785e3ba0088f0886caa17893db (commit)
from 9f179a8b8acf6fa23091445fc1332357d1fe1644 (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 89b46374d746fe785e3ba0088f0886caa17893db
Author: radhika <radhika at curoverse.com>
Date: Fri Sep 23 14:09:20 2016 -0400
9514: if logs are not found in logs table, do not show the log div for a completed container.
diff --git a/apps/workbench/app/views/work_units/_show_log.html.erb b/apps/workbench/app/views/work_units/_show_log.html.erb
index 6a0916f..323c9e8 100644
--- a/apps/workbench/app/views/work_units/_show_log.html.erb
+++ b/apps/workbench/app/views/work_units/_show_log.html.erb
@@ -9,12 +9,15 @@
</div>
<% end %>
-<%# Show log in terminal window %>
+<% live_log_lines = wu.live_log_lines(Rails.configuration.running_job_log_records_to_fetch).join("\n") %>
+<% if !render_log or (live_log_lines.size > 0) %>
+<%# Still running, or recently finished and logs are still available from logs table %>
+<%# Show recent logs in terminal window %>
<h4>Recent logs</h4>
<div id="event_log_div"
class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window"
data-object-uuids="<%= wu.log_object_uuids.join(' ') %>"
- ><%= wu.live_log_lines(Rails.configuration.running_job_log_records_to_fetch).join("\n") %>
+ ><%= live_log_lines %>
</div>
<%# Applying a long throttle suppresses the auto-refresh of this
@@ -22,3 +25,4 @@
<div class="arv-log-refresh-control"
data-load-throttle="86486400000" <%# 1001 nights %>>
</div>
+<% end %>
diff --git a/apps/workbench/test/controllers/container_requests_controller_test.rb b/apps/workbench/test/controllers/container_requests_controller_test.rb
index c738343..8dbbbd0 100644
--- a/apps/workbench/test/controllers/container_requests_controller_test.rb
+++ b/apps/workbench/test/controllers/container_requests_controller_test.rb
@@ -1,7 +1,7 @@
require 'test_helper'
class ContainerRequestsControllerTest < ActionController::TestCase
- test "visit container_request log" do
+ test "visit completed container request log tab" do
use_token 'active'
cr = api_fixture('container_requests')['completed']
@@ -13,5 +13,20 @@ class ContainerRequestsControllerTest < ActionController::TestCase
assert_select "a", {:href=>"/collections/#{container['log']}", :text=>"Download the log"}
assert_select "a", {:href=>"#{container['log']}/baz"}
+ assert_not_includes @response.body, '<div id="event_log_div"'
+ end
+
+ test "visit running container request log tab" do
+ use_token 'active'
+
+ cr = api_fixture('container_requests')['running']
+ container_uuid = cr['container_uuid']
+ container = Container.find(container_uuid)
+
+ get :show, {id: cr['uuid'], tab_pane: 'Log'}, session_for(:active)
+ assert_response :success
+
+ assert_includes @response.body, '<div id="event_log_div"'
+ assert_select 'Download the log', false
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list