diff mbox series

[v3,1/3] patchtest: use HEAD commit as base for the selftest and not master

Message ID 20241118162643.1423409-1-alex.kanavin@gmail.com
State New
Headers show
Series [v3,1/3] patchtest: use HEAD commit as base for the selftest and not master | expand

Commit Message

Alexander Kanavin Nov. 18, 2024, 4:26 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Patchtest applies patches on top of poky master branch by default;
this means selftest does the same, and any commits from the branch-under-test
are then discarded.

This can cause issues for example, if bitbake-server process started by selftest
from the master branch tries to parse bitbake.conf from the branch under test:
https://valkyrie.yoctoproject.org/#/builders/71/builds/460

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/lib/patchtest/selftest/selftest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Trevor Gamblin Nov. 18, 2024, 4:33 p.m. UTC | #1
On 2024-11-18 11:26, Alexander Kanavin via lists.openembedded.org wrote:
> From: Alexander Kanavin <alex@linutronix.de>
>
> Patchtest applies patches on top of poky master branch by default;
> this means selftest does the same, and any commits from the branch-under-test
> are then discarded.
>
> This can cause issues for example, if bitbake-server process started by selftest
> from the master branch tries to parse bitbake.conf from the branch under test:
> https://valkyrie.yoctoproject.org/#/builders/71/builds/460
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
LGTM.
> ---
>   meta/lib/patchtest/selftest/selftest | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/lib/patchtest/selftest/selftest b/meta/lib/patchtest/selftest/selftest
> index 6fad50ce616..3cf1c361f7f 100755
> --- a/meta/lib/patchtest/selftest/selftest
> +++ b/meta/lib/patchtest/selftest/selftest
> @@ -38,7 +38,7 @@ def test(root, patch):
>       res = True
>       patchpath = os.path.abspath(os.path.join(root, patch))
>       
> -    cmd     = 'patchtest --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath)
> +    cmd     = 'patchtest --base-commit HEAD --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath)
>       results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True)
>   
>       return results
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#207222): https://lists.openembedded.org/g/openembedded-core/message/207222
> Mute This Topic: https://lists.openembedded.org/mt/109647316/7611679
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [tgamblin@baylibre.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/lib/patchtest/selftest/selftest b/meta/lib/patchtest/selftest/selftest
index 6fad50ce616..3cf1c361f7f 100755
--- a/meta/lib/patchtest/selftest/selftest
+++ b/meta/lib/patchtest/selftest/selftest
@@ -38,7 +38,7 @@  def test(root, patch):
     res = True
     patchpath = os.path.abspath(os.path.join(root, patch))
     
-    cmd     = 'patchtest --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath)
+    cmd     = 'patchtest --base-commit HEAD --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath)
     results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True)
 
     return results