[ARVADOS] updated: 9d879418786a63c1b7d90be274360b8739411009

git at public.curoverse.com git at public.curoverse.com
Mon Mar 2 16:05:51 EST 2015


Summary of changes:
 .../pipeline_instances/_running_component.html.erb |  2 +-
 .../test/integration/pipeline_instances_test.rb    | 32 ++++++++++++++--------
 services/api/test/fixtures/pipeline_instances.yml  |  6 +++-
 3 files changed, 27 insertions(+), 13 deletions(-)

       via  9d879418786a63c1b7d90be274360b8739411009 (commit)
      from  6be95f5c3a2fcbe6321bba52c20393060e33e637 (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 9d879418786a63c1b7d90be274360b8739411009
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Mon Mar 2 16:04:17 2015 -0500

    5349: Reverted "Time.iso8601(current_job[:created_at]" back to "current_job[:created_at]". All tests and manual testing passed and no negative side effects are observed.

diff --git a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
index 4359860..f87dede 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -39,7 +39,7 @@
           <% if current_job[:state] == "Queued" %>
             <%# column offset 5 %>
             <div class="col-md-6">
-              <% queuetime = Time.now - Time.iso8601(current_job[:created_at]) %>
+              <% queuetime = Time.now - current_job[:created_at] %>
               Queued for <%= render_runtime(queuetime, true) %>.
               <% begin %>
                 <% if current_job[:queue_position] == 0 %>
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index f012b09..eac190a 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -412,28 +412,38 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   end
 
   [
-    [1, 0], # run time 0 minutes
-    [10, 17*60*60 + 51*60], # run time 17 hours and 51 minutes
-  ].each do |index, run_time|
-    test "pipeline start and finish time display #{index}" do
-      visit page_with_token("user1_with_load", "/pipeline_instances/zzzzz-d1hrv-10pipelines0#{index.to_s.rjust(3, '0')}")
+    ['zzzzz-d1hrv-10pipelines0001', 0], # run time 0 minutes
+    ['zzzzz-d1hrv-10pipelines0010', 17*60*60 + 51*60], # run time 17 hours and 51 minutes
+    ['zzzzz-d1hrv-10pipelines0002', nil], # state = running
+  ].each do |uuid, run_time|
+    test "pipeline start and finish time display for #{uuid}" do
+      visit page_with_token("user1_with_load", "/pipeline_instances/#{uuid}")
 
       assert page.has_text? 'This pipeline started at'
       page_text = page.text
 
-      match = /This pipeline started at (.*)\. It failed after (.*) seconds at (.*)\. Check the Log/.match page_text
+      if run_time
+        match = /This pipeline started at (.*)\. It failed after (.*) seconds at (.*)\. Check the Log/.match page_text
+      else
+        match = /This pipeline started at (.*). It has been active for(.*)/.match page_text
+      end
       assert_not_nil(match, 'Did not find text - This pipeline started at . . . ')
 
       start_at = match[1]
-      finished_at = match[3]
       assert_not_nil(start_at, 'Did not find start_at time')
-      assert_not_nil(finished_at, 'Did not find finished_at time')
 
       # start and finished time display is of the format '2:20 PM 10/20/2014'
       start_time = DateTime.strptime(start_at, '%H:%M %p %m/%d/%Y').to_time
-      finished_time = DateTime.strptime(finished_at, '%H:%M %p %m/%d/%Y').to_time
-      assert_equal(run_time, finished_time-start_time,
-        "Time difference did not match for start_at #{start_at}, finished_at #{finished_at}, ran_for #{match[2]}")
+      if run_time
+        finished_at = match[3]
+        assert_not_nil(finished_at, 'Did not find finished_at time')
+        finished_time = DateTime.strptime(finished_at, '%H:%M %p %m/%d/%Y').to_time
+        assert_equal(run_time, finished_time-start_time,
+          "Time difference did not match for start_at #{start_at}, finished_at #{finished_at}, ran_for #{match[2]}")
+      else
+        match = /\d(.*)/.match match[2]
+        assert_not_nil match, 'Did not find expected match for running component'
+      end
     end
   end
 
diff --git a/services/api/test/fixtures/pipeline_instances.yml b/services/api/test/fixtures/pipeline_instances.yml
index 69e1f7d..376808b 100644
--- a/services/api/test/fixtures/pipeline_instances.yml
+++ b/services/api/test/fixtures/pipeline_instances.yml
@@ -240,12 +240,16 @@ pipeline_in_publicly_accessible_project:
 <% for i in 1..10 do %>
 pipeline_<%=i%>_of_10:
   name: pipeline_<%= i %>
-  state: Failed
   uuid: zzzzz-d1hrv-10pipelines0<%= i.to_s.rjust(3, '0') %>
   owner_uuid: zzzzz-j7d0g-000010pipelines
   created_at: <%= (2*(i-1)).hour.ago.to_s(:db) %>
   started_at: <%= (2*(i-1)).hour.ago.to_s(:db) %>
+<% if i != 2 %>
   finished_at: <%= (i-1).minute.ago.to_s(:db) %>
+  state: Failed
+<% else %>
+  state: Running
+<% end %>
   components:
     foo:
       script: foo

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list