diff mbox series

python3-license-expression: Make the ptest work as expected

Message ID 20250210093609.3899881-1-mingli.yu@eng.windriver.com
State New
Headers show
Series python3-license-expression: Make the ptest work as expected | expand

Commit Message

mingli.yu@eng.windriver.com Feb. 10, 2025, 9:36 a.m. UTC
From: Mingli Yu <mingli.yu@windriver.com>

After below commit introduced, the do_install_ptest function is defined
concentratedly in ptest-python-pytest.bbclass.
8d84d9e19b python3-*: Update recipes with pytest ptests to use the new ptest-python-pytest class

Use append for do_install_ptest to avoid the do_install_ptest logic defined
in ptest-python-pytest.bbclass be overrided.

Before the patch:
 # cd /usr/lib/python3-license-expression/ptest/
 # ls
 setup.cfg  src

After the patch:
 # cd /usr/lib/python3-license-expression/ptest/
 # ls
run-ptest  setup.cfg  src  tests
 # ./run-ptest
PASS: tests/test__pyahocorasick.py:TestTrie.test_add_can_get
PASS: tests/test__pyahocorasick.py:TestTrie.test_add_existing_WordShouldReplaceAssociatedValue
PASS: tests/test__pyahocorasick.py:TestTrie.test_exists_ShouldDetectAddedWords
PASS: tests/test__pyahocorasick.py:TestTrie.test_exists_ShouldReturnFailOnUnknownWord
PASS: tests/test__pyahocorasick.py:TestTrie.test_get_UnknowWordWithDefaultValueShouldReturnDefault
PASS: tests/test__pyahocorasick.py:TestTrie.test_get_UnknowWordWithoutDefaultValueShouldRaiseException
PASS: tests/test__pyahocorasick.py:TestTrie.test_is_prefix_ShouldDetecAllPrefixesIncludingWord
PASS: tests/test__pyahocorasick.py:TestTrie.test_items_ShouldReturnAllItemsAlreadyAddedToTheTrie
PASS: tests/test__pyahocorasick.py:TestTrie.test_iter_should_can_return_non_matches_optionally
PASS: tests/test__pyahocorasick.py:TestTrie.test_iter_should_not_return_non_matches_by_default
PASS: tests/test__pyahocorasick.py:TestTrie.test_iter_simple
[snip]

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 .../python/python3-license-expression_30.4.1.bb                 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ross Burton Feb. 12, 2025, 8:32 p.m. UTC | #1
On 10 Feb 2025, at 09:36, Yu, Mingli via lists.openembedded.org <mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
> -do_install_ptest() {
> +do_install_ptest:append() {
>     install -d ${D}${PTEST_PATH}/src
>     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
>     cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/

I didn’t like how this test was installing the entire source tree again, so I just sent a patch to surgically install just what the tests need.

Ross
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
index 649b53ea49..73eeff9c06 100644
--- a/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
+++ b/meta/recipes-devtools/python/python3-license-expression_30.4.1.bb
@@ -22,7 +22,7 @@  RDEPENDS:${PN} += "\
 
 BBCLASSEXTEND = "native nativesdk"
 
-do_install_ptest() {
+do_install_ptest:append() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
     cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/