Skip to contentSkip to conversation

python3-xmlschema: adding ptest

PATCH In review Jan Vermaete 2 participants 2 messages Nov 9, 2024 – Nov 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-xmlschema: adding ptest

Running them in qemu took about 6m.

A few tests are ignored with the -k option of pytest.
* Because some input files where missing
* Windows only tests (although with a skip in the pytest)
* tests that needed input()

---
 .../include/ptest-packagelists-meta-python.inc     |  1 +
 .../python/python3-xmlschema/run-ptest             |  9 +++++++++
 .../python/python3-xmlschema_3.4.2.bb              | 14 +++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
index ee8f957cc..72b4ef5ad 100644
@@ -91,6 +91,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-wrapt \
     python3-wsproto \
     python3-xlrd \
+    python3-xmlschema \
     python3-xmltodict \
     python3-xxhash \
     python3-yarl \
meta-python/recipes-devtools/python/python3-xmlschema/run-ptest new file +9 -0
new file mode 100644
index 000000000..971b45be4
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# List of test not to run at ptest
+#   SKIP: tests/test_locations.py:TestLocations.test_normalize_url_with_base_unc_path_on_windows # SKIP Run only on Windows systems
+#   FAIL: tests/test_package.py:TestPackaging.test_version
+#   FAIL: tests/test_package.py:TestPackaging.test_elementpath_requirement
+#   FAIL: tests/test_package.py:TestPackaging.test_forgotten_debug_statements
+
+pytest --automake -k 'not TestLocations and not TestPackaging'
meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb +13 -1
index b29862b1d..388f69c7c 100644
@@ -5,11 +5,23 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=26aa26eda991a3a2b61c11b62d3fda65"
 
 SRC_URI[sha256sum] = "d35023ea504ea46127302d1297b046d023b96fec5fe4b4b690534ea85b5e9bf8"
 
-inherit pypi python_setuptools_build_meta
+SRC_URI:append = " file://run-ptest"
+
+inherit pypi python_setuptools_build_meta ptest
 
 RDEPENDS:${PN} += "\
     python3-elementpath \
     python3-modules \
 "
 
+RDEPENDS:${PN}-ptest += "\
+    python3-pytest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.5
#1 lore raw

Thanks for adding ptests support to this recipe. However, I have merged the upgrade to 3.4.3 today which was queued in master-next for a while. Please rebase this patch on top of master or master-next as of today and resend a v2 please.

Quoted 84 lines · Jan Vermaete via lists.openembedded.org

Running them in qemu took about 6m.

A few tests are ignored with the -k option of pytest.
* Because some input files where missing
* Windows only tests (although with a skip in the pytest)
* tests that needed input()

---
 .../include/ptest-packagelists-meta-python.inc     |  1 +
 .../python/python3-xmlschema/run-ptest             |  9 +++++++++
 .../python/python3-xmlschema_3.4.2.bb              | 14 +++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
index ee8f957cc..72b4ef5ad 100644
@@ -91,6 +91,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-wrapt \
     python3-wsproto \
     python3-xlrd \
+    python3-xmlschema \
     python3-xmltodict \
     python3-xxhash \
     python3-yarl \
meta-python/recipes-devtools/python/python3-xmlschema/run-ptest new file +9 -0
new file mode 100644
index 000000000..971b45be4
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# List of test not to run at ptest
+#   SKIP: tests/test_locations.py:TestLocations.test_normalize_url_with_base_unc_path_on_windows # SKIP Run only on Windows systems
+#   FAIL: tests/test_package.py:TestPackaging.test_version
+#   FAIL: tests/test_package.py:TestPackaging.test_elementpath_requirement
+#   FAIL: tests/test_package.py:TestPackaging.test_forgotten_debug_statements
+
+pytest --automake -k 'not TestLocations and not TestPackaging'
meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb +13 -2
index b29862b1d..388f69c7c 100644
@@ -5,11 +5,23 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=26aa26eda991a3a2b61c11b62d3fda65"
 
 SRC_URI[sha256sum] = "d35023ea504ea46127302d1297b046d023b96fec5fe4b4b690534ea85b5e9bf8"
 
-inherit pypi python_setuptools_build_meta
+SRC_URI:append = " file://run-ptest"
+
+inherit pypi python_setuptools_build_meta ptest
 
 RDEPENDS:${PN} += "\
     python3-elementpath \
     python3-modules \
 "
 
+RDEPENDS:${PN}-ptest += "\
+    python3-pytest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
 BBCLASSEXTEND = "native nativesdk"
--

2.39.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#113770): https://lists.openembedded.org/g/openembedded-devel/message/113770
Mute This Topic: https://lists.openembedded.org/mt/109480868/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-