jenkins-bot has submitted this change and it was merged.

Change subject: check-voter ignore l10-bot + tests
......................................................................


check-voter ignore l10-bot + tests

The l10n-bot would still trigger test jobs on patchset proposal. Ignore
it entirely.

Add basic tests covering the l10n-bot behavior. It is based on
mediawiki/core project and ensure that:

 patches from l10n-bot sent to check/check-voter/test are not triggering
jobs.
 a CR+2 by l10n-bot is matched by gate-and-submit

Change-Id: Id8f453aee8a54727f97c7a411154f1a039ab16b9
---
M tests/test_zuul_layout.py
M zuul/layout.yaml
2 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/test_zuul_layout.py b/tests/test_zuul_layout.py
index b48f5c5..2836d95 100644
--- a/tests/test_zuul_layout.py
+++ b/tests/test_zuul_layout.py
@@ -240,3 +240,32 @@
         trusted_event.account = {'email': '[email protected]'}
         self.assertFalse(check_manager.eventMatches(trusted_event, change))
         self.assertTrue(test_manager.eventMatches(trusted_event, change))
+
+    def test_l10nbot_patchets_are_ignored(self):
+        managers = [self.getPipeline(p).manager
+                    for p in ['check', 'check-only', 'check-voter', 'test']]
+        change = zuul.model.Change('mediawiki/core')
+
+        l10n_event = zuul.model.TriggerEvent()
+        l10n_event.type = 'patchset-created'
+        l10n_event.account = {'email': '[email protected]'}
+
+        [self.assertFalse(manager.eventMatches(l10n_event, change),
+                          'l10-bot should not enter %s pipeline' %
+                          manager.pipeline.name)
+         for manager in managers]
+
+    def test_l10nbot_allowed_in_gate_and_submit(self):
+        gate = self.getPipeline('gate-and-submit').manager
+        change = zuul.model.Change('mediawiki/core')
+
+        l10n_event = zuul.model.TriggerEvent()
+        l10n_event.type = 'comment-added'
+        l10n_event.account = {'email': '[email protected]'}
+        l10n_event.approvals = [{'type': 'Code-Review',
+                                 'description': 'Code Review',
+                                 'value': '2',
+                                 'by': {'email': '[email protected]'},
+                                 }]
+
+        self.assertTrue(gate.eventMatches(l10n_event, change))
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 67d36bb..f231804 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -196,6 +196,8 @@
     trigger:
       gerrit:
         - event: patchset-created
+          email:
+           - ^(?!l10n-bot@translatewiki\.net).*$
         - event: comment-added
           comment_filter: (?im)^Patch Set \d+:\n\n\s*recheck\.?\s*$
     success-message: 'Basic test build succeeded.'

-- 
To view, visit https://gerrit.wikimedia.org/r/197649
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8f453aee8a54727f97c7a411154f1a039ab16b9
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to