Bug 9946 - patchtest: must be able to test the series on every branch specified on mbox summary
Summary: patchtest: must be able to test the series on every branch specified on mbox...
Status: RESOLVED FIXED
Alias: None
Product: Patchwork/Patchtest
Classification: Yocto Project Subprojects
Component: Patchtest (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.5
Assignee: Leonardo Sandoval Gonzalez
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 10716
  Show dependency tree
 
Reported: 2016-07-14 21:22 UTC by Leonardo Sandoval Gonzalez
Modified: 2017-12-06 17:03 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonardo Sandoval Gonzalez 2016-07-14 21:22:27 UTC
Right now, patchtest just run the set of checks for a single branch but commonly people send patches to multiple branches (krogoth/jethro/master), e.g. CVE patches and the system must be able to check on each one.

Current implementation parses the '[PATCH ]' summary prefix and works on the first valid branch.
Comment 1 Leonardo Sandoval Gonzalez 2017-01-25 17:43:50 UTC
This is nice feature but current release is already too loaded with patchtest work and currently work is focused on stabilization and the test suite. Moving it to next release.
Comment 2 Leonardo Sandoval Gonzalez 2017-06-15 19:28:30 UTC
At 2.4, the focus is on the python 2 to python 3 migration, tinfoil usage and stabilization of these two. So moving it to 2.5
Comment 3 Leonardo Sandoval Gonzalez 2017-06-23 16:00:51 UTC
Right now, we have the following commit to stop sending false positives, but need to better handle by indicating patchtest which branch to use, so test test_series_merge_on_head is generic



commit d2aba545588264e1135fa9b651145467178e4c8a
Author: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Date:   Fri Jun 23 08:57:55 2017 -0700

    test_mbox_merge: skip test on stable branches
    
    Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

diff --git a/tests/test_mbox_merge.py b/tests/test_mbox_merge.py
index 6d70d6c..04039b1 100644
--- a/tests/test_mbox_merge.py
+++ b/tests/test_mbox_merge.py
@@ -32,7 +32,18 @@ class Merge(base.Base):
 
     def test_series_merge_on_head(self):
         if not pti.repo.ismerged:
-            commithash, author, date, shortlog = headlog()
-            self.fail('Series does not apply on top of target branch',
-                      'Rebase your series on top of targeted branch',
-                      data=[('Targeted branch', '%s (currently at %s)' % (pti.repo.branch, commithash))])
+
+            # TODO: in order to stop sending false-positives, do this check on
+            # patchtest-oe instead of selecting the correct branch from patchtest.
+            # Currently patchtest is not able to test on non-master branches,
+            # so we need to avoid testing on patches targeted for the following
+            # stable releases
+            stable_releases = ['krogoth', 'morty', 'pyro']
+            subjects = [commit.subject for commit in self.commits]
+            for release in stable_releases:
+                if release in subjects[0]:
+                    self.skip('Non-master branch %s, skip test' % release, data=[('patch', pti.repo.patch)])
+            else:
+                commithash, author, date, shortlog = headlog()
+                self.fail('Series does not apply on top of target branch', 'Rebase your series on top of targeted branch',
+                          data=[('Targeted branch', '%s (currently at %s)' % (pti.repo.branch, commithash))])
Comment 4 Leonardo Sandoval Gonzalez 2017-11-28 17:09:14 UTC
This enhancement is partially completed in the framework. By partially I meant that if a single series is intended for multiple branches, then just one branch will be tested (the first that match with a oe-core branch, i.e. master, pyro, rocko, etc.). IMO, this this good enough because series usually  are targeted to a single branch, not multiple, so patchtest will do its job as expected.