[ARVADOS] updated: 8f4c794c573d64e4be53ace480248cdfabe26fc7

git at public.curoverse.com git at public.curoverse.com
Mon Mar 9 00:20:40 EDT 2015


Summary of changes:
 apps/workbench/app/views/projects/show.html.erb    |  2 +-
 .../test/integration/pipeline_instances_test.rb    | 51 ++++++++++++++++-
 sdk/python/arvados/api.py                          | 65 +++++++++++-----------
 sdk/python/arvados/keep.py                         | 16 ++++++
 sdk/python/tests/test_api.py                       |  7 +++
 .../controllers/arvados/v1/schema_controller.rb    |  1 +
 services/api/config/application.default.yml        |  6 ++
 7 files changed, 113 insertions(+), 35 deletions(-)

       via  8f4c794c573d64e4be53ace480248cdfabe26fc7 (commit)
       via  1df8b46242badf6ae0189cbbe33b75695a455d2c (commit)
       via  1fa86a46b6a7b6000528e67f899608d058c159ae (commit)
       via  fcad01c98cfc6bab6af9c6d461692c28bfba6de8 (commit)
       via  5fbc413ccdabc9c7551f13e5a76573d72c438251 (commit)
       via  068189e8be1e83066ea3c7b79a1dfdb2dcacde54 (commit)
       via  3979c83819a07b544aa4a0510bbeb58d1c92905a (commit)
       via  b434a3a88bffcf068b500c430d6a0db0c6923190 (commit)
       via  0b4ad564482929d3f8eaefe8324df54bb276b74b (commit)
       via  78387b4fb0abf03bbc6523acec7babf1e6ef321b (commit)
       via  4d26f92c806e36c4dcfcb4809c854d5081c86fff (commit)
      from  8c19d0da4331ba9c2605543f70c0f55875f41497 (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 8f4c794c573d64e4be53ace480248cdfabe26fc7
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Mar 9 00:10:25 2015 -0400

    5261: Fix DST transition bug: browser timezone != test suite timezone.

diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index f8d5796..f291674 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -5,6 +5,51 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     need_javascript
   end
 
+  def parse_browser_timestamp t
+    # Timestamps are displayed in the browser's time zone (which can
+    # differ from ours) and they come from toLocaleTimeString (which
+    # means they don't necessarily tell us which time zone they're
+    # using). In order to make sense of them, we need to ask the
+    # browser to parse them and generate a timestamp that can be
+    # parsed reliably.
+    #
+    # Note: Even with all this help, phantomjs seem to behave badly
+    # when parsing timestamps on the other side of a DST transition.
+    # See skipped tests below.
+    if /(\d+:\d+ [AP]M) (\d+\/\d+\/\d+)/ =~ t
+      # Currently dates.js renders timestamps as
+      # '{t.toLocaleTimeString()} {t.toLocaleDateString()}' which even
+      # browsers can't make sense of. First we need to flip it around
+      # so it looks like what toLocaleString() would have made.
+      t = $~[2] + ', ' + $~[1]
+    end
+    DateTime.parse(page.evaluate_script "new Date('#{t}').toUTCString()").to_time
+  end
+
+  if false
+    # No need to test (or mention) these all the time. If they start
+    # working (without need_selenium) then some real tests might not
+    # need_selenium any more.
+
+    test 'phantomjs DST' do
+      skip '^^'
+      t0s = '3/8/2015, 01:59 AM'
+      t1s = '3/8/2015, 03:01 AM'
+      t0 = parse_browser_timestamp t0s
+      t1 = parse_browser_timestamp t1s
+      assert_equal 120, t1-t0, "'#{t0s}' to '#{t1s}' was reported as #{t1-t0} seconds, should be 120"
+    end
+
+    test 'phantomjs DST 2' do
+      skip '^^'
+      t0s = '2015-03-08T10:43:00Z'
+      t1s = '2015-03-09T03:43:00Z'
+      t0 = parse_browser_timestamp page.evaluate_script("new Date('#{t0s}').toLocaleString()")
+      t1 = parse_browser_timestamp page.evaluate_script("new Date('#{t1s}').toLocaleString()")
+      assert_equal 17*3600, t1-t0, "'#{t0s}' to '#{t1s}' was reported as #{t1-t0} seconds, should be #{17*3600} (17 hours)"
+    end
+  end
+
   test 'Create and run a pipeline' do
     visit page_with_token('active_trustedclient', '/pipeline_templates')
     within('tr', text: 'Two Part Pipeline Template') do
@@ -417,6 +462,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     ['active', 'zzzzz-d1hrv-runningpipeline', nil], # state = running
   ].each do |user, uuid, run_time|
     test "pipeline start and finish time display for #{uuid}" do
+      need_selenium 'to parse timestamps correctly across DST boundaries'
       visit page_with_token(user, "/pipeline_instances/#{uuid}")
 
       assert page.has_text? 'This pipeline started at'
@@ -432,12 +478,11 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       start_at = match[1]
       assert_not_nil(start_at, 'Did not find start_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
+      start_time = parse_browser_timestamp start_at
       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
+        finished_time = parse_browser_timestamp finished_at
         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

commit 1df8b46242badf6ae0189cbbe33b75695a455d2c
Merge: 1fa86a4 fcad01c
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Mar 8 15:03:29 2015 -0400

    5261: Merge branch 'master' into 5261-project-description


commit 1fa86a46b6a7b6000528e67f899608d058c159ae
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Mar 8 15:03:08 2015 -0400

    5261: Change placeholder text from "New group" to "New project"

diff --git a/apps/workbench/app/views/projects/show.html.erb b/apps/workbench/app/views/projects/show.html.erb
index 0bf1e45..2a85da8 100644
--- a/apps/workbench/app/views/projects/show.html.erb
+++ b/apps/workbench/app/views/projects/show.html.erb
@@ -3,7 +3,7 @@
     <% if @object.uuid == current_user.andand.uuid %>
       Home
     <% else %>
-      <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New #{controller.model_class.to_s.underscore.gsub("_"," ")}" } %>
+      <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
     <% end %>
   </h2>
 <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list