[ARVADOS] updated: a7256debf497de78acd670c053bcaf2f5600fcaa

git at public.curoverse.com git at public.curoverse.com
Fri Nov 7 10:22:29 EST 2014


Summary of changes:
 apps/workbench/app/views/jobs/_show_log.html.erb   | 13 +++-
 .../views/pipeline_instances/_show_log.html.erb    |  2 +-
 apps/workbench/test/integration/websockets_test.rb | 80 ++++++++++++----------
 3 files changed, 55 insertions(+), 40 deletions(-)

       via  a7256debf497de78acd670c053bcaf2f5600fcaa (commit)
      from  270b1fc3ec06a24057301a1e49d1f46b6fed3ebe (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 a7256debf497de78acd670c053bcaf2f5600fcaa
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Nov 7 10:22:26 2014 -0500

    4084: Add 'arv-log-refresh-control' div to job log pane.  Log scrolling test tests both pipeline_instance and job log panes.

diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index 2531f14..8082d6f 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -2,9 +2,16 @@
 
 <% log_history = stderr_log_history([@object.uuid]) %>
 
-<div class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window" id="pipeline_event_log_div" data-object-uuid="<%= @object.uuid %>"><%= log_history.join("\n") %>
-</div>
-
+<div id="event_log_div"
+     class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window"
+     data-object-uuid="<%= @object.uuid %>"
+     ><%= log_history.join("\n") %></div>
+
+<%# Applying a long throttle suppresses the auto-refresh of this
+    partial that would normally be triggered by arv-log-event. %>
+<div class="arv-log-refresh-control"
+     data-load-throttle="86486400000" <%# 1001 nights %>
+     ></div>
 
 <% else %>
 
diff --git a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
index 4bb7ab0..bb756a0 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
@@ -1,6 +1,6 @@
 <% log_uuids = [@object.uuid] + pipeline_jobs(@object).collect{|x|x[:job].andand[:uuid]}.compact %>
 <% log_history = stderr_log_history(log_uuids) %>
-<div id="pipeline_event_log_div"
+<div id="event_log_div"
      class="arv-log-event-listener arv-log-event-handler-append-logs arv-log-event-subscribe-to-pipeline-job-uuids arv-job-log-window"
      data-object-uuids="<%= log_uuids.join(' ') %>"
      ><%= log_history.join("\n") %></div>
diff --git a/apps/workbench/test/integration/websockets_test.rb b/apps/workbench/test/integration/websockets_test.rb
index 65784af..341975f 100644
--- a/apps/workbench/test/integration/websockets_test.rb
+++ b/apps/workbench/test/integration/websockets_test.rb
@@ -33,52 +33,60 @@ class WebsocketTest < ActionDispatch::IntegrationTest
     Thread.current[:arvados_api_token] = nil
   end
 
-  test "test live logging scrolling" do
-    visit(page_with_token("admin", "/pipeline_instances/zzzzz-d1hrv-9fm8l10i9z2kqc6"))
-    click_link("Log")
-    assert_no_text '123 hello'
 
-    api = ArvadosApiClient.new
+  [["pipeline_instances", api_fixture("pipeline_instances")['pipeline_with_newer_template']['uuid']],
+   ["jobs", api_fixture("jobs")['running']['uuid']]].each do |c|
+    test "test live logging scrolling #{c[0]}" do
 
-    text = ""
-    (1..1000).each do |i|
-      text << "#{i} hello\n"
-    end
+      controller = c[0]
+      uuid = c[1]
 
-    Thread.current[:arvados_api_token] = @@API_AUTHS["admin"]['api_token']
-    api.api("logs", "", {log: {
-                object_uuid: "zzzzz-d1hrv-9fm8l10i9z2kqc6",
-                event_type: "stderr",
-                properties: {"text" => text}}})
-    assert_text '1000 hello'
+      visit(page_with_token("admin", "/#{controller}/#{uuid}"))
+      click_link("Log")
+      assert_no_text '123 hello'
 
-    # First test that when we're already at the bottom of the page, it scrolls down
-    # when a new line is added.
-    old_top = page.evaluate_script("$('#pipeline_event_log_div').scrollTop()")
+      api = ArvadosApiClient.new
 
-    api.api("logs", "", {log: {
-                object_uuid: "zzzzz-d1hrv-9fm8l10i9z2kqc6",
-                event_type: "stderr",
-                properties: {"text" => "1001 hello\n"}}})
-    assert_text '1001 hello'
+      text = ""
+      (1..1000).each do |i|
+        text << "#{i} hello\n"
+      end
 
-    # Check that new value of scrollTop is greater than the old one
-    assert page.evaluate_script("$('#pipeline_event_log_div').scrollTop()") > old_top
+      Thread.current[:arvados_api_token] = @@API_AUTHS["admin"]['api_token']
+      api.api("logs", "", {log: {
+                  object_uuid: uuid,
+                  event_type: "stderr",
+                  properties: {"text" => text}}})
+      assert_text '1000 hello'
 
-    # Now scroll to 30 pixels from the top
-    page.execute_script "$('#pipeline_event_log_div').scrollTop(30)"
-    assert_equal 30, page.evaluate_script("$('#pipeline_event_log_div').scrollTop()")
+      # First test that when we're already at the bottom of the page, it scrolls down
+      # when a new line is added.
+      old_top = page.evaluate_script("$('#event_log_div').scrollTop()")
 
-    api.api("logs", "", {log: {
-                object_uuid: "zzzzz-d1hrv-9fm8l10i9z2kqc6",
-                event_type: "stderr",
-                properties: {"text" => "1002 hello\n"}}})
-    assert_text '1002 hello'
+      api.api("logs", "", {log: {
+                  object_uuid: uuid,
+                  event_type: "stderr",
+                  properties: {"text" => "1001 hello\n"}}})
+      assert_text '1001 hello'
 
-    # Check that we haven't changed scroll position
-    assert_equal 30, page.evaluate_script("$('#pipeline_event_log_div').scrollTop()")
+      # Check that new value of scrollTop is greater than the old one
+      assert page.evaluate_script("$('#event_log_div').scrollTop()") > old_top
 
-    Thread.current[:arvados_api_token] = nil
+      # Now scroll to 30 pixels from the top
+      page.execute_script "$('#event_log_div').scrollTop(30)"
+      assert_equal 30, page.evaluate_script("$('#event_log_div').scrollTop()")
+
+      api.api("logs", "", {log: {
+                  object_uuid: uuid,
+                  event_type: "stderr",
+                  properties: {"text" => "1002 hello\n"}}})
+      assert_text '1002 hello'
+
+      # Check that we haven't changed scroll position
+      assert_equal 30, page.evaluate_script("$('#event_log_div').scrollTop()")
+
+      Thread.current[:arvados_api_token] = nil
+    end
   end
 
   test "pipeline instance arv-refresh-on-log-event" do

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list