[OE-core] ✗ patchtest: failure for ovmf: Bump to edk2-stable201905 and add improvements

Ricardo Neri ricardo.neri-calderon at linux.intel.com
Wed Aug 7 19:45:58 UTC 2019


On Wed, Aug 07, 2019 at 02:02:07AM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: ovmf: Bump to edk2-stable201905 and add improvements
> Revision: 1
> URL   : https://patchwork.openembedded.org/series/19138/
> State : failure
> 
> == Summary ==
> 
> 
> Thank you for submitting this patch series to OpenEmbedded Core. This is
> an automated response. Several tests have been executed on the proposed
> series by patchtest resulting in the following failures:
> 
> 
> 
> * Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
>   Suggested fix    Rebase your series on top of targeted branch
>   Targeted branch  master (currently at f03ab9b21c)

It looks like patchtest thinks the patchset does not apply because of
the line endings EDK2 uses. If patchest used git am --keep-cr the
patches would apply cleanly.

Also the Patch class in lib/patchestpatch.py in the patch test repo
reads the patch using f.read() with the newline parameter implicitly set
to None and this causes newlines to be translated from \r\n into \n.
Hence, when applying the patch with git am it fails; even when using
--keep-cr.

I was able to pass the patchtest tests with this change:

diff --git a/lib/patchtestpatch.py b/lib/patchtestpatch.py
index e05d22f..4583b5c 100644
--- a/lib/patchtestpatch.py
+++ b/lib/patchtestpatch.py
@@ -47,7 +47,7 @@ class Patch(object):
         if self._forcereload or (not self._contents):
             logger.debug('Reading %s contents' % self._path)
             try:
-                with open(self._path) as _f:
+                with open(self._path, newline='') as _f:
                     self._contents = _f.read()
             except IOError:
                 logger.warn("Reading the mbox %s failed" % self.resource)
diff --git a/lib/patchtestrepo.py b/lib/patchtestrepo.py
index edc17d4..3c38b9c 100644
--- a/lib/patchtestrepo.py
+++ b/lib/patchtestrepo.py
@@ -71,7 +71,7 @@ class Repo(object):
         # Check if patch can be merged using git-am
         self._patchcanbemerged = True
         try:
-            self._exec({'cmd': ['git', 'am'], 'input': self._patch.contents})
+            self._exec({'cmd': ['git', 'am', '--keep-cr'], 'input': self._patch.contents})
         except utils.CmdException as ce:
             self._exec({'cmd': ['git', 'am', '--abort']})
             self._patchcanbemerged = False
@@ -174,7 +174,7 @@ class Repo(object):

     def merge(self):
         if self._patchcanbemerged:
-            self._exec({'cmd': ['git', 'am'],
+            self._exec({'cmd': ['git', 'am', '--keep-cr'],
                         'input': self._patch.contents,
                         'updateenv': {'PTRESOURCE':self._patch.path}})
             self._patchmerged = True
diff --git a/scripts/test-mboxes b/scripts/test-mboxes
index 9137ba4..1d0c6f7 100755
--- a/scripts/test-mboxes
+++ b/scripts/test-mboxes
@@ -116,13 +116,13 @@ function testpatch() {
 	    # try patch merge
 	    if git apply --check $patch 2> /dev/null; then
 		if [ -n "$mergeall" ]; then
-		    git am --quiet $patch 2>/dev/null && gitnotes
+		    git am --quiet --keep-cr $patch 2>/dev/null && gitnotes
 		    echo -e "\tPatch merged into '${assemblebranch}' including all test results"
 		else
-		    if [ "$(echo "$PTRESULTS" | any-fail)" == "yes"]; then
+		    if [ "$(echo "$PTRESULTS" | any-fail)" == "yes" ]; then
 			echo -e "\tPatch has test failures, skipping"
 		    else
-			git am --quiet $patch 2>/dev/null && gitnotes
+			git am --quiet --keep-cr $patch 2>/dev/null && gitnotes
 			echo -e "\tPatch merged into '${assemblebranch}' with no test failures"
 		    fi
 		fi


Thanks and BR,
Ricardo
> 
> 
> 
> If you believe any of these test results are incorrect, please reply to the
> mailing list (openembedded-core at lists.openembedded.org) raising your concerns.
> Otherwise we would appreciate you correcting the issues and submitting a new
> version of the patchset if applicable. Please ensure you add/increment the
> version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> [PATCH v3] -> ...).
> 
> ---
> Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> 


More information about the Openembedded-core mailing list