1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class PipelineInstancesHelperTest < ActionView::TestCase
9 r = [{started_at: 1, finished_at: 3}]
10 assert_equal 2, determine_wallclock_runtime(r)
12 r = [{started_at: 1, finished_at: 5}]
13 assert_equal 4, determine_wallclock_runtime(r)
15 r = [{started_at: 1, finished_at: 2}, {started_at: 3, finished_at: 5}]
16 assert_equal 3, determine_wallclock_runtime(r)
18 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2}]
19 assert_equal 3, determine_wallclock_runtime(r)
21 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 2},
22 {started_at: 2, finished_at: 4}]
23 assert_equal 4, determine_wallclock_runtime(r)
25 r = [{started_at: 1, finished_at: 5}, {started_at: 2, finished_at: 3}]
26 assert_equal 4, determine_wallclock_runtime(r)
28 r = [{started_at: 3, finished_at: 5}, {started_at: 1, finished_at: 4}]
29 assert_equal 4, determine_wallclock_runtime(r)
31 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5}]
32 assert_equal 4, determine_wallclock_runtime(r)
34 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
35 {started_at: 5, finished_at: 8}]
36 assert_equal 7, determine_wallclock_runtime(r)
38 r = [{started_at: 1, finished_at: 4}, {started_at: 3, finished_at: 5},
39 {started_at: 6, finished_at: 8}]
40 assert_equal 6, determine_wallclock_runtime(r)