Skip to content

Commit

Permalink
Filter nils from step-list before creating contexts to make sure nils…
Browse files Browse the repository at this point in the history
… don't get step ids (which is what UIs expect). Fixes #172
  • Loading branch information
flosell committed Oct 31, 2017
1 parent 583bf97 commit bbd8124
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions example/clj/todopipeline/pipeline.clj
Expand Up @@ -52,6 +52,7 @@
(in-parallel
;; these child steps do some actual work with the checked out git repo
(with-frontend-git
nil
create-some-details
client-package
client-publish)
Expand Down
5 changes: 2 additions & 3 deletions src/clj/lambdacd/execution/internal/execute_steps.clj
Expand Up @@ -81,6 +81,5 @@
(let [handler-chain (-> (call-step-result-producer step-result-producer)
(wrap-inheritance unify-results-fn)
(kill/wrap-execute-steps-with-kill-handling is-killed)
(retrigger/wrap-retrigger-handling retrigger-predicate)
(wrap-filter-nil-steps))]
(handler-chain (contexts-for-steps steps ctx) args ctx)))
(retrigger/wrap-retrigger-handling retrigger-predicate))]
(handler-chain (contexts-for-steps (filter not-nil? steps) ctx) args ctx)))
Expand Up @@ -79,7 +79,7 @@
(execute-steps [some-successful-step step-that-expects-a-kill-switch] {} (some-ctx-with :step-id [0])))))
(testing "that nil values (e.g. from an optional step in the structure) do not cause problems and are ignored"
(is (= {:outputs { [1 0] {:status :success}} :status :success}
(execute-steps [some-successful-step nil] {} (some-ctx-with :step-id [0]))))))
(execute-steps [nil some-successful-step] {} (some-ctx-with :step-id [0]))))))



0 comments on commit bbd8124

Please sign in to comment.