diff mbox series

[meta-python] python3-xmlschema: adding ptest

Message ID 20241109132009.78919-1-jan.vermaete@gmail.com
State New
Headers show
Series [meta-python] python3-xmlschema: adding ptest | expand

Commit Message

Jan Vermaete Nov. 9, 2024, 1:20 p.m. UTC
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()

Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
---
 .../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

Comments

Khem Raj Nov. 19, 2024, 9:09 p.m. UTC | #1
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.

On Sat, Nov 9, 2024 at 5:20 AM Jan Vermaete via lists.openembedded.org
<jan.vermaete=gmail.com@lists.openembedded.org> wrote:
>
> 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()
>
> Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
> ---
>  .../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
>
> diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
> index ee8f957cc..72b4ef5ad 100644
> --- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
> +++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
> @@ -91,6 +91,7 @@ PTESTS_FAST_META_PYTHON = "\
>      python3-wrapt \
>      python3-wsproto \
>      python3-xlrd \
> +    python3-xmlschema \
>      python3-xmltodict \
>      python3-xxhash \
>      python3-yarl \
> diff --git a/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest b/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
> new file mode 100644
> index 000000000..971b45be4
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
> @@ -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'
> diff --git a/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb b/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
> index b29862b1d..388f69c7c 100644
> --- a/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
> +++ b/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
> @@ -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: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index ee8f957cc..72b4ef5ad 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -91,6 +91,7 @@  PTESTS_FAST_META_PYTHON = "\
     python3-wrapt \
     python3-wsproto \
     python3-xlrd \
+    python3-xmlschema \
     python3-xmltodict \
     python3-xxhash \
     python3-yarl \
diff --git a/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest b/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
new file mode 100644
index 000000000..971b45be4
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-xmlschema/run-ptest
@@ -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'
diff --git a/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb b/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
index b29862b1d..388f69c7c 100644
--- a/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
+++ b/meta-python/recipes-devtools/python/python3-xmlschema_3.4.2.bb
@@ -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"