|
13 | 13 |
|
14 | 14 |
|
15 | 15 | (def foo-pipeline-build-state
|
16 |
| - {'(1) { :status :running} |
| 16 | + {'(1) {:status :running} |
17 | 17 | '(1 1 1) {:status :failure
|
18 |
| - :out "do stuff failed"} |
19 |
| - '(1 2 1) {:status :running |
| 18 | + :out "do stuff failed"} |
| 19 | + '(1 2 1) {:status :running |
20 | 20 | :some-key :some-value}})
|
21 | 21 |
|
22 | 22 | (def expected-unified-foo-pipeline-presentation
|
23 |
| - [{:name "in-parallel" |
24 |
| - :type :parallel |
25 |
| - :step-id '(1) |
26 |
| - :has-dependencies false |
27 |
| - :result {:status :running } |
28 |
| - :children |
29 |
| - [{:name "in-cwd" |
30 |
| - :type :container |
31 |
| - :step-id '(1 1) |
32 |
| - :has-dependencies false |
33 |
| - :result {} |
34 |
| - :children [{:name "do-stuff" |
35 |
| - :type :step |
36 |
| - :step-id '(1 1 1) |
37 |
| - :has-dependencies false |
38 |
| - :children [] |
39 |
| - :result {:status :failure |
40 |
| - :out "do stuff failed"}}]} |
41 |
| - {:name "in-cwd" |
42 |
| - :type :container |
43 |
| - :step-id '(2 1) |
44 |
| - :has-dependencies false |
45 |
| - :result {} |
46 |
| - :children [{:name "do-other-stuff" |
47 |
| - :type :step |
48 |
| - :step-id '(1 2 1) |
49 |
| - :has-dependencies false |
50 |
| - :children [] |
51 |
| - :result {:status :running :some-key :some-value}}]}]}]) |
| 23 | + [{:name "in-parallel" |
| 24 | + :type :parallel |
| 25 | + :step-id '(1) |
| 26 | + :has-dependencies false |
| 27 | + :result {:status :running} |
| 28 | + :children |
| 29 | + [{:name "in-cwd" |
| 30 | + :type :container |
| 31 | + :step-id '(1 1) |
| 32 | + :has-dependencies false |
| 33 | + :result {} |
| 34 | + :children [{:name "do-stuff" |
| 35 | + :type :step |
| 36 | + :step-id '(1 1 1) |
| 37 | + :has-dependencies false |
| 38 | + :children [] |
| 39 | + :result {:status :failure |
| 40 | + :out "do stuff failed"}}]} |
| 41 | + {:name "in-cwd" |
| 42 | + :type :container |
| 43 | + :step-id '(2 1) |
| 44 | + :has-dependencies false |
| 45 | + :result {} |
| 46 | + :children [{:name "do-other-stuff" |
| 47 | + :type :step |
| 48 | + :step-id '(1 2 1) |
| 49 | + :has-dependencies false |
| 50 | + :children [] |
| 51 | + :result {:status :running :some-key :some-value}}]}]}]) |
| 52 | + |
| 53 | +(def foo-pipeline-structure |
| 54 | + [{:name "in-parallel" |
| 55 | + :type :parallel |
| 56 | + :step-id '(1) |
| 57 | + :has-dependencies false |
| 58 | + :children |
| 59 | + [{:name "in-cwd" |
| 60 | + :type :container |
| 61 | + :step-id '(1 1) |
| 62 | + :has-dependencies false |
| 63 | + :children [{:name "do-stuff" |
| 64 | + :type :step |
| 65 | + :step-id '(1 1 1) |
| 66 | + :has-dependencies false |
| 67 | + :children []}]} |
| 68 | + {:name "in-cwd" |
| 69 | + :type :container |
| 70 | + :step-id '(2 1) |
| 71 | + :has-dependencies false |
| 72 | + :result {} |
| 73 | + :children [{:name "do-other-stuff" |
| 74 | + :type :step |
| 75 | + :step-id '(1 2 1) |
| 76 | + :has-dependencies false |
| 77 | + :children []}]}]}]) |
52 | 78 |
|
53 | 79 | (deftest unified-presentation-test
|
54 | 80 | (testing "that we can merge structure and state to a unified view on a pipeline-run"
|
55 |
| - (is (= expected-unified-foo-pipeline-presentation (unified-presentation foo-pipeline foo-pipeline-build-state))))) |
| 81 | + (testing "deprecated call with pipeline-def" |
| 82 | + (is (= expected-unified-foo-pipeline-presentation (unified-presentation foo-pipeline foo-pipeline-build-state)))) |
| 83 | + (testing "call with build-result" |
| 84 | + (is (= expected-unified-foo-pipeline-presentation (pipeline-structure-with-step-results foo-pipeline-structure foo-pipeline-build-state)))))) |
0 commit comments