3 class PipelineInstancesControllerTest < ActionController::TestCase
4 include PipelineInstancesHelper
7 r = [{started_at: 1, finished_at: 3}]
8 assert_equal 2, determine_wallclock_runtime(r)
10 r = [{started_at: 1, finished_at: 5}]
11 assert_equal 4, determine_wallclock_runtime(r)
13 r = [{started_at: 1, finished_at: 2}, {started_at: 3, finished_at: 5}]
14 assert_equal 3, determine_wallclock_runtime(r)
16 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2}]
17 assert_equal 3, determine_wallclock_runtime(r)
19 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2},
20 {started_at: 2, finished_at: 4}]
21 assert_equal 4, determine_wallclock_runtime(r)
23 r = [{started_at: 1, finished_at: 5}, {started_at: 2, finished_at: 3}]
24 assert_equal 4, determine_wallclock_runtime(r)
26 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 4}]
27 assert_equal 4, determine_wallclock_runtime(r)
29 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5}]
30 assert_equal 4, determine_wallclock_runtime(r)
32 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
33 {started_at: 5, finished_at: 8}]
34 assert_equal 7, determine_wallclock_runtime(r)
36 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
37 {started_at: 6, finished_at: 8}]
38 assert_equal 6, determine_wallclock_runtime(r)