|
136 | 136 | :to "direct@test.org"} |
137 | 137 | "public-list" {:admin "admin@test.org" |
138 | 138 | :source-type :mailing-list |
139 | | - :list "list.test.org"}}) |
| 139 | + :list "list.test.org"} |
| 140 | + "no-triggers" {:admin "admin@test.org" |
| 141 | + :source-type :mailbox |
| 142 | + :to "no-triggers@test.org" |
| 143 | + :patch-triggers? false}}) |
140 | 144 |
|
141 | 145 | (def sources [{:name "public-list" |
142 | 146 | :list "list.test.org"} |
143 | 147 | {:name "direct" |
144 | | - :to "direct@test.org"}]) |
| 148 | + :to "direct@test.org"} |
| 149 | + {:name "no-triggers" |
| 150 | + :to "no-triggers@test.org" |
| 151 | + :patch-triggers? false}]) |
145 | 152 |
|
146 | 153 | ;; --------------------------------------------------------------------------- |
147 | 154 | ;; DB setup / teardown |
|
156 | 163 | :maint-tenure/email "admin@test.org" |
157 | 164 | :maint-tenure/order 0} |
158 | 165 | {:maint-tenure/source "public-list" |
| 166 | + :maint-tenure/email "admin@test.org" |
| 167 | + :maint-tenure/order 0} |
| 168 | + {:maint-tenure/source "no-triggers" |
159 | 169 | :maint-tenure/email "admin@test.org" |
160 | 170 | :maint-tenure/order 0}]) |
161 | 171 | ;; Insert test emails. Fixtures only set :email/from-address / |
|
471 | 481 | (is (= "orgweb|kana@test.org|2" |
472 | 482 | (:series/id (:report/series r127)))))) |
473 | 483 |
|
| 484 | + ;; --- :patch-triggers? false on source (emails 128-129) --- |
| 485 | + (testing "Source with :patch-triggers? false skips auto-credit" |
| 486 | + (let [bug (get-report db "<128@test.org>") |
| 487 | + patch (get-report db "<129@test.org>")] |
| 488 | + (is (= :bug (:report/type bug))) |
| 489 | + (is (= :patch (:report/type patch))) |
| 490 | + ;; The :resolves cross-link is still recorded -- only the |
| 491 | + ;; side effects on the bug are gated. |
| 492 | + (is (some #(= "<128@test.org>" (:report/message-id %)) |
| 493 | + (all-related patch)) |
| 494 | + ":resolves cross-link is still recorded") |
| 495 | + ;; No auto-credit fired on the bug. |
| 496 | + (is (nil? (:report/acked bug)) |
| 497 | + "auto-acked must NOT fire when :patch-triggers? is false") |
| 498 | + (is (nil? (:report/owned bug)) |
| 499 | + "auto-owned must NOT fire when :patch-triggers? is false") |
| 500 | + (is (nil? (:report/closed bug)) |
| 501 | + "the bug must remain open after the patch arrives"))) |
| 502 | + |
474 | 503 | ;; --- Email 40 patch related to bug --- |
475 | 504 | (testing "Email 40 patch related to bug" |
476 | 505 | (let [patch (get-report db "<40@test.org>") |
|
0 commit comments