[ARVADOS] updated: c02331eb9e7d302efdd788af0dd3ba9124352edb

git at public.curoverse.com git at public.curoverse.com
Fri Sep 26 13:50:54 EDT 2014


Summary of changes:
 .../functional/pipeline_instances_controller_test.rb | 11 +++++++++++
 services/api/test/fixtures/pipeline_instances.yml    | 20 ++++++++++++++++++++
 2 files changed, 31 insertions(+)

       via  c02331eb9e7d302efdd788af0dd3ba9124352edb (commit)
      from  44242bfe2c86302c65650cf7fe3a7187223c6304 (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 c02331eb9e7d302efdd788af0dd3ba9124352edb
Author: Tim Pierce <twp at curoverse.com>
Date:   Fri Sep 26 13:45:43 2014 -0400

    3901: added unit test for pipeline rendering

diff --git a/apps/workbench/test/functional/pipeline_instances_controller_test.rb b/apps/workbench/test/functional/pipeline_instances_controller_test.rb
index fbfbf34..40f3b79 100644
--- a/apps/workbench/test/functional/pipeline_instances_controller_test.rb
+++ b/apps/workbench/test/functional/pipeline_instances_controller_test.rb
@@ -78,4 +78,15 @@ class PipelineInstancesControllerTest < ActionController::TestCase
         session_for(:active))
     assert_response :success
   end
+
+  test "dates in JSON components are parsed" do
+    get(:show,
+        {id: api_fixture('pipeline_instances')['has_component_with_completed_jobs']['uuid']},
+        session_for(:active))
+    assert_response :success
+    assert_not_nil assigns(:object)
+    assert_not_nil assigns(:object).components[:foo][:job]
+    assert assigns(:object).components[:foo][:job][:started_at].is_a? Time
+    assert assigns(:object).components[:foo][:job][:finished_at].is_a? Time
+  end
 end
diff --git a/services/api/test/fixtures/pipeline_instances.yml b/services/api/test/fixtures/pipeline_instances.yml
index 7bfc2e1..ede86a1 100644
--- a/services/api/test/fixtures/pipeline_instances.yml
+++ b/services/api/test/fixtures/pipeline_instances.yml
@@ -25,6 +25,26 @@ has_component_with_empty_script_parameters:
     script: foo
     script_version: master
 
+has_component_with_completed_jobs:
+  # Test that the job "started_at" and "finished_at" fields are
+  # parsed into Time fields when rendering. This job must *not*
+  # have its own fixture; the point is to force the
+  # pipeline_instances_controller_test in Workbench to parse
+  # the "components" field.
+  state: Complete
+  uuid: zzzzz-d1hrv-i3e77t9z5y8j9cc
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  components:
+   foo:
+    script: foo
+    script_version: master
+    script_parameters: {}
+    job:
+      uuid: zzzzz-8i9sb-rft1xdewxkwgxnz
+      script_version: master
+      started_at: <%= 10.minute.ago.to_s(:db) %>
+      finished_at: <%= 9.minute.ago.to_s(:db) %>
+
 has_job:
   name: pipeline_with_job
   state: Ready

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list