diff mbox series

[3/4] patchtest: ignore patch file metadata from SRC_URI

Message ID 20250915090208.2007216-3-skandigraun@gmail.com
State New
Headers show
Series [1/4] patchtest: apply patch in repo root | expand

Commit Message

Gyorgy Sarvari Sept. 15, 2025, 9:02 a.m. UTC
The test_src_uri_left_files check prepares a list of patchfiles SRC_URI from
before and after the patch is applied, looking for dangling patches.

The name of the files in this list can be incorrect, in case the URI contains
some extra metadata (like patchdir), because os.path.basename will use the last portion
of the line being processed, which is independent from the files in question.

To avoid this, try to use only the first portion of URI, before any extra metadata.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 meta/lib/patchtest/tests/test_metadata.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/patchtest/tests/test_metadata.py b/meta/lib/patchtest/tests/test_metadata.py
index 63d01819e7..30da8dbe60 100644
--- a/meta/lib/patchtest/tests/test_metadata.py
+++ b/meta/lib/patchtest/tests/test_metadata.py
@@ -150,8 +150,8 @@  class TestMetadata(base.Metadata):
                 "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn)
             ].split()
 
-            pretest_files = set([os.path.basename(patch) for patch in pretest_src_uri if patch.startswith('file://')])
-            test_files    = set([os.path.basename(patch) for patch in test_src_uri    if patch.startswith('file://')])
+            pretest_files = set([os.path.basename(patch.split(';')[0]) for patch in pretest_src_uri if patch.startswith('file://')])
+            test_files    = set([os.path.basename(patch.split(';')[0]) for patch in test_src_uri    if patch.startswith('file://')])
 
             # check if files were removed
             if len(test_files) < len(pretest_files):