3 class PipelineInstancesHelperTest < ActionView::TestCase
5 r = [{started_at: 1, finished_at: 3}]
6 assert_equal 2, determine_wallclock_runtime(r)
8 r = [{started_at: 1, finished_at: 5}]
9 assert_equal 4, determine_wallclock_runtime(r)
11 r = [{started_at: 1, finished_at: 2}, {started_at: 3, finished_at: 5}]
12 assert_equal 3, determine_wallclock_runtime(r)
14 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2}]
15 assert_equal 3, determine_wallclock_runtime(r)
17 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2},
18 {started_at: 2, finished_at: 4}]
19 assert_equal 4, determine_wallclock_runtime(r)
21 r = [{started_at: 1, finished_at: 5}, {started_at: 2, finished_at: 3}]
22 assert_equal 4, determine_wallclock_runtime(r)
24 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 4}]
25 assert_equal 4, determine_wallclock_runtime(r)
27 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5}]
28 assert_equal 4, determine_wallclock_runtime(r)
30 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
31 {started_at: 5, finished_at: 8}]
32 assert_equal 7, determine_wallclock_runtime(r)
34 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
35 {started_at: 6, finished_at: 8}]
36 assert_equal 6, determine_wallclock_runtime(r)