Skip to contentSkip to conversation

patchtest: skip merge test if not targeting master

PATCH New Trevor Gamblin 1 participant 1 message Oct 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 patchtest: skip merge test if not targeting master

Avoid testing mergeability of a patch when not targeting master, so that patches tested via other means (e.g. maintainer branches and AB runs) don't get unnecessarily reviewed an extra time.

---
v2 corrects the logic in the new if statement (modified during a test) and states which branch was detected as a patch target when printing the message. It also adds a detailed commit message so that it'll pass the patchtest check.

 meta/lib/patchtest/tests/test_mbox_merge.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/patchtest/tests/test_mbox_merge.py +2 -0
index bc55c588b40..f69d57c71b1 100644
@@ -18,6 +18,8 @@ def headlog():
 
 class Merge(base.Base):
     def test_series_merge_on_head(self):
+        if PatchTestInput.repo.branch != "master":
+            self.skip("Skipping merge test since patch is not intended for master branch. Target detected is %s" % PatchTestInput.repo.branch)
         if not PatchTestInput.repo.ismerged:
             commithash, author, date, shortlog = headlog()
             self.fail('Series does not apply on top of target branch. Rebase your series and ensure the target is correct',
Signature · 1 line
2.41.0