python3-numpy: add missing dependency for the tests
PATCH 1/17 python3-numpy: add missing dependency for the tests
--- meta/recipes-devtools/python/python3-numpy_1.24.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3-numpy_1.24.2.bb +1 -0
@@ -66,6 +66,7 @@ RDEPENDS:${PN}-ptest += "${PYTHON_PN}-pytest \ ${PYTHON_PN}-hypothesis \ ${PYTHON_PN}-sortedcontainers \ ${PYTHON_PN}-resource \ + ${PYTHON_PN}-typing-extensions \ ldd \ "
Signature · 1 line
2.34.1
PATCH 2/17 python3: missing ptest dependencies
The tests need a broad set of locales and timezones to be installed.
--- meta/recipes-devtools/python/python3_3.11.2.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python3_3.11.2.bb +2 -2
@@ -426,8 +426,8 @@ FILES:${PN}-man = "${datadir}/man" # See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395 RDEPENDS:libpython3:append:libc-glibc = " libgcc" RDEPENDS:${PN}-ctypes:append:libc-glibc = " ${MLPREFIX}ldconfig" -RDEPENDS:${PN}-ptest = "${PN}-modules ${PN}-tests ${PN}-dev unzip bzip2 libgcc tzdata-europe coreutils sed" -RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-tr-tr.iso-8859-9" +RDEPENDS:${PN}-ptest = "${PN}-modules ${PN}-tests ${PN}-dev unzip bzip2 libgcc tzdata coreutils sed" +RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-fr-fr locale-base-en-us locale-base-tr-tr locale-base-de-de" RDEPENDS:${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', '${MLPREFIX}tk ${MLPREFIX}tk-lib', '', d)}" RDEPENDS:${PN}-idle += "${@bb.utils.contains('PACKAGECONFIG', 'tk', '${PN}-tkinter ${MLPREFIX}tcl', '', d)}" DEV_PKG_DEPENDENCY = ""
Signature · 1 line
2.34.1
PATCH 3/17 python3: add missing -modules dependencies
In reply to Ross BurtonThe python3-modules package should depend on zoneinfo, and gdbm if it was enabled.
--- meta/recipes-devtools/python/python3/python3-manifest.json | 3 ++- meta/recipes-devtools/python/python3_3.11.2.bb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3/python3-manifest.json +2 -1
@@ -835,7 +835,8 @@ "unixadmin", "venv", "xml", - "xmlrpc" + "xmlrpc", + "zoneinfo" ], "rrecommends": [ "distutils-windows"
meta/recipes-devtools/python/python3_3.11.2.bb +1 -0
@@ -417,6 +417,7 @@ RDEPENDS:${PN}-misc += "\ " RDEPENDS:${PN}-modules:append:class-target = " ${MLPREFIX}python3-misc" RDEPENDS:${PN}-modules:append:class-nativesdk = " ${MLPREFIX}python3-misc" +RDEPENDS:${PN}-modules:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '${MLPREFIX}python3-gdbm', '', d)}" FILES:${PN}-misc = "${libdir}/python${PYTHON_MAJMIN} ${libdir}/python${PYTHON_MAJMIN}/lib-dynload" # catch manpage
Signature · 1 line
2.34.1
PATCH 4/17 python3-unittest-automake-output: add new recipe for ptest integration
In reply to Ross BurtonThis package contains modules for both unittest and pytest that alter the output to look like automake's 'make check' output, for better integration with ptest.
--- .../python/python3-unittest-automake-output_0.1.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-unittest-automake-output_0.1.bb
meta/recipes-devtools/python/python3-unittest-automake-output_0.1.bb new file +12 -0
@@ -0,0 +1,12 @@ +SUMMARY = "Modules to make unittest and pytest look like Automake output, for ptest" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=f6f16008d9fb7349f06609329f1ab93b" + +SRC_URI = "git://gitlab.com/rossburton/python-unittest-automake-output;protocol=https;branch=main" +SRCREV = "06537edb18f3641c70bce25256f6ecf5f5164ead" + +S = "${WORKDIR}/git" + +inherit python_flit_core + +BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1
Re: [OE-core] [PATCH 04/17] python3-unittest-automake-output: add new recipe for ptest integration
Quoted 18 lines · Ross Burton
This package contains modules for both unittest and pytest that alter the output to look like automake's 'make check' output, for better integration with ptest.
Signed-off-by Ross Burton <[email protected]>--- .../python/python3-unittest-automake-output_0.1.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-unittest-automake-output_0.1.bbmeta/recipes-devtools/python/python3-unittest-automake-output_0.1.bb new file +2
-0@@ -0,0 +1,12 @@ +SUMMARY = "Modules to make unittest and pytest look like Automake output, for ptest" +LICENSE = "MIT"
meta/recipes-devtools/python/python3-unittest-automake-output_0.1.bb line 12
Quoted 10 lines
meta/recipes-devtools/python/python3-unittest-automake-output_0.1.bb new file +10
-0+LIC_FILES_CHKSUM = "file://LICENSE;md5=f6f16008d9fb7349f06609329f1ab93b" + +SRC_URI = "git://gitlab.com/rossburton/python-unittest-automake-output;protocol=https;branch=main" +SRCREV = "06537edb18f3641c70bce25256f6ecf5f5164ead" + +S = "${WORKDIR}/git" + +inherit python_flit_core + +BBCLASSEXTEND = "native nativesdk"
This needs a MAINTAINER entry else we'll get selftest failures. I tweaked the patch in -next for that.
Cheers,
Richard
PATCH 5/17 python3-atomicwrites: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-atomicwrites/run-ptest | 2 +- meta/recipes-devtools/python/python3-atomicwrites_1.4.1.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-atomicwrites/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-atomicwrites_1.4.1.bb +1 -0
@@ -13,6 +13,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ ${PYTHON_PN}-unixadmin \ "
Signature · 1 line
2.34.1
PATCH 6/17 python3-bcrypt: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-bcrypt/run-ptest | 2 +- meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-bcrypt/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb +1 -0
@@ -17,6 +17,7 @@ require ${BPN}-crates.inc RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 7/17 python3-cryptography: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
Also show a skip message instead of nothing if the tests were skipped due to a lack of memory.
--- .../python/python3-cryptography/check-memfree.py | 2 +- meta/recipes-devtools/python/python3-cryptography/run-ptest | 5 ++++- meta/recipes-devtools/python/python3-cryptography_39.0.2.bb | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python3-cryptography/check-memfree.py +1 -1
@@ -4,7 +4,7 @@ import sys meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines()) mem_free = meminfo['MemTotal']/1024./1024. if mem_free < 2.: - raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free)) + print("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free)) sys.exit(1) else: print("Free memory: {:.3f} GB".format(mem_free))
meta/recipes-devtools/python/python3-cryptography/run-ptest +4 -1
@@ -1,4 +1,7 @@ #!/bin/sh + if ./check-memfree.py; then - pytest -vvvv tests/ -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' + pytest tests/ --automake +else + echo "SKIP: crytography.not_enough_memory" fi
meta/recipes-devtools/python/python3-cryptography_39.0.2.bb +1 -0
@@ -43,6 +43,7 @@ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pretend \ ${PYTHON_PN}-psutil \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ ${PYTHON_PN}-pytest-subtests \ ${PYTHON_PN}-pytz \ "
Signature · 1 line
2.34.1
PATCH 8/17 python3-hypothesis: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-hypothesis/run-ptest | 2 +- meta/recipes-devtools/python/python3-hypothesis_6.68.2.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-hypothesis/run-ptest +1 -1
@@ -7,4 +7,4 @@ # # Instead we run two test suites imported from examples/ -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-hypothesis_6.68.2.bb +1 -0
@@ -27,6 +27,7 @@ RDEPENDS:${PN} += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 9/17 python3-jinja2: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-jinja2/run-ptest | 2 +- meta/recipes-devtools/python/python3-jinja2_3.1.2.bb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
meta/recipes-devtools/python/python3-jinja2/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest +pytest --automake
meta/recipes-devtools/python/python3-jinja2_3.1.2.bb +5 -5
@@ -12,8 +12,7 @@ CVE_PRODUCT = "jinja2 jinja" CLEANBROKEN = "1" -inherit pypi setuptools3 -inherit ${@bb.utils.filter('DISTRO_FEATURES', 'ptest', d)} +inherit pypi setuptools3 ptest SRC_URI += " \ file://run-ptest \
@@ -25,9 +24,10 @@ do_install_ptest() { } RDEPENDS:${PN}-ptest += " \ - ${PYTHON_PN}-pytest \ - ${PYTHON_PN}-toml \ - ${PYTHON_PN}-unixadmin \ + ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ + ${PYTHON_PN}-toml \ + ${PYTHON_PN}-unixadmin \ " RDEPENDS:${PN} += " \
Signature · 1 line
2.34.1
PATCH 10/17 python3-markupsafe: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-markupsafe/run-ptest | 2 +- meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-markupsafe/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest +pytest --automake
meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +2 -2
@@ -6,8 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=ffeffa59c90c9c4a033c7574f8f3fb75" SRC_URI[sha256sum] = "abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d" PYPI_PACKAGE = "MarkupSafe" -inherit pypi setuptools3 -inherit ${@bb.utils.filter('DISTRO_FEATURES', 'ptest', d)} +inherit pypi setuptools3 ptest RDEPENDS:${PN} += "${PYTHON_PN}-stringold"
@@ -19,6 +18,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
Re: [OE-core] [PATCH 10/17] python3-markupsafe: use python3-unittest-automake-output
Quoted 32 lines · Ross Burton
Instead of using sed to reformat the output use this new module.
Signed-off-by Ross Burton <[email protected]>--- meta/recipes-devtools/python/python3-markupsafe/run-ptest | 2 +- meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python3-markupsafe/run-ptest +1
-1@@ -1,3 +1,3 @@ #!/bin/sh -pytest +pytest --automakemeta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +1
-2@@ -6,8 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=ffeffa59c90c9c4a033c7574f8f3fb75" SRC_URI[sha256sum] = "abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d" PYPI_PACKAGE = "MarkupSafe" -inherit pypi setuptools3 -inherit ${@bb.utils.filter('DISTRO_FEATURES', 'ptest', d)} +inherit pypi setuptools3 ptest RDEPENDS:${PN} += "${PYTHON_PN}-stringold"
meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb SRC_URI += " \ · line 24
Quoted 7 lines
meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +1
-0@@ -19,6 +18,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Where is sed being used to reformat the output? I'm mainly proving I did read the patches :)
Thanks for putting this series together, it does clean up all those horrible sed expressions which is great to see.
Cheers,
Richard
Re: [OE-core] [PATCH 10/17] python3-markupsafe: use python3-unittest-automake-output
Quoted 40 lines · Richard Purdie
Quoted 38 lines · Ross Burton
Instead of using sed to reformat the output use this new module.
Signed-off-by Ross Burton <[email protected]>---
meta/recipes-devtools/python/python3-markupsafe/run-ptest | 2 +- meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb | 4 ++--2 files changed, 3 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python3-markupsafe/run-ptest +1
-1@@ -1,3 +1,3 @@ #!/bin/sh -pytest +pytest --automakemeta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +0
-0@@ -6,8 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=ffeffa59c90c9c4a033c7574f8f3fb75"SRC_URI[sha256sum] = "
abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d"
PYPI_PACKAGE= "MarkupSafe"meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +1
-2-inherit pypi setuptools3 -inherit ${@bb.utils.filter('DISTRO_FEATURES', 'ptest', d)} +inherit pypi setuptools3 ptestRDEPENDS:${PN} += "${PYTHON_PN}-stringold"
meta/recipes-devtools/python/python3-markupsafe_2.1.2.bb +1
-0@@ -19,6 +18,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \"
Quoted 4 lines
Quoted 1 line
do_install_ptest(){Where is sed being used to reformat the output? I'm mainly proving I did read the patches :)
You got me: this one didn’t even do the sed dance but I was copy/pasting the commit message. :)
Ross
PATCH 11/17 python3-more-itertools: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-more-itertools/run-ptest | 2 +- meta/recipes-devtools/python/python3-more-itertools_9.1.0.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-more-itertools/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-more-itertools_9.1.0.bb +1 -0
@@ -17,6 +17,7 @@ RDEPENDS:${PN} += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 12/17 python3-pluggy: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-pluggy/run-ptest | 2 +- meta/recipes-devtools/python/python3-pluggy_1.0.0.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-pluggy/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-pluggy_1.0.0.bb +1 -0
@@ -18,6 +18,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 13/17 python3-pyasn1: : use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python-pyasn1.inc | 1 + meta/recipes-devtools/python/python3-pyasn1/run-ptest | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python-pyasn1.inc +1 -0
@@ -24,6 +24,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
meta/recipes-devtools/python/python3-pyasn1/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
Signature · 1 line
2.34.1
PATCH 14/17 python3-pytz: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-pytz/run-ptest | 2 +- meta/recipes-devtools/python/python3-pytz_2022.7.1.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-pytz/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-pytz_2022.7.1.bb +1 -0
@@ -24,6 +24,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 15/17 python3-wcwidth: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-wcwidth/run-ptest | 2 +- meta/recipes-devtools/python/python3-wcwidth_0.2.6.bb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python3-wcwidth/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-wcwidth_0.2.6.bb +2 -1
@@ -14,11 +14,12 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() { install -d ${D}${PTEST_PATH}/tests - cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/ + cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/ } BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1
PATCH 16/17 python3-webcolors: use python3-unittest-automake-output
In reply to Ross BurtonInstead of using sed to reformat the output use this new module.
--- meta/recipes-devtools/python/python3-webcolors/run-ptest | 2 +- meta/recipes-devtools/python/python3-webcolors_1.12.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-webcolors/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest --automake
meta/recipes-devtools/python/python3-webcolors_1.12.bb +1 -0
@@ -17,6 +17,7 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1
PATCH 17/17 python3-jsonpointer: rewrite testing
In reply to Ross BurtonThe tests installed by jsonpointer use unittest not pytest, so update the dependencies.
Use the unittest runner in python3-unittest-automake-output to get the correct output.
Apply a patch so the test suite doesn't run twice.
--- .../0001-Clean-up-test-runner.patch | 62 +++++++++++++++++++ .../python/python3-jsonpointer/run-ptest | 2 +- .../python/python3-jsonpointer_2.3.bb | 6 +- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/python/python3-jsonpointer/0001-Clean-up-test-runner.patch
meta/recipes-devtools/python/python3-jsonpointer/0001-Clean-up-test-runner.patch new file +62 -0
@@ -0,0 +1,62 @@ +From 04a864f33848da6af1dea906ba4922770022ef66 Mon Sep 17 00:00:00 2001 +From: Ross Burton <[email protected]> +Date: Thu, 16 Mar 2023 14:21:32 +0000 +Subject: [PATCH] Clean up test runner + +Test code doesn't need to manually construct a TestSuite and a +TextTestRunner, the unittest module has a discovery function that does +all this for you. + +Delete all of the manual logic from tests.py, replace it with the two +lines to bring in the doctest unit tests, and update the makefile to +run the unittest discovery. + +Upstream-Status: Submitted [https://github.com/stefankoegl/python-json-pointer/pull/54] +Signed-off-by: Ross Burton <[email protected]> +--- + makefile | 2 +- + tests.py | 24 ++++-------------------- + 2 files changed, 5 insertions(+), 21 deletions(-) + +diff --git a/tests.py b/tests.py +index 9252369..6b4b8cc 100755 +--- a/tests.py ++++ b/tests.py +@@ -7,6 +7,7 @@ import doctest + import unittest + import sys + import copy ++import jsonpointer + from jsonpointer import resolve_pointer, EndOfList, JsonPointerException, \ + JsonPointer, set_pointer + +@@ -410,23 +411,6 @@ class AltTypesTests(unittest.TestCase): + self.assertRaises(JsonPointerException, resolve_pointer, doc, '/root/1/2/3/4') + + +- +-suite = unittest.TestSuite() +-suite.addTest(unittest.makeSuite(SpecificationTests)) +-suite.addTest(unittest.makeSuite(ComparisonTests)) +-suite.addTest(unittest.makeSuite(WrongInputTests)) +-suite.addTest(unittest.makeSuite(ToLastTests)) +-suite.addTest(unittest.makeSuite(SetTests)) +-suite.addTest(unittest.makeSuite(AltTypesTests)) +- +-modules = ['jsonpointer'] +- +-for module in modules: +- m = __import__(module, fromlist=[module]) +- suite.addTest(doctest.DocTestSuite(m)) +- +-runner = unittest.TextTestRunner(verbosity=1) +-result = runner.run(suite) +- +-if not result.wasSuccessful(): +- sys.exit(1) ++def load_tests(loader, tests, ignore): ++ tests.addTests(doctest.DocTestSuite(jsonpointer)) ++ return tests +-- +2.34.1 +
meta/recipes-devtools/python/python3-jsonpointer/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -python3 tests.py +python3 -mputao.unittest tests.py
meta/recipes-devtools/python/python3-jsonpointer_2.3.bb +5 -1
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=32b15c843b7a329130f4e266a281ebb3" inherit pypi ptest setuptools3 +SRC_URI += "file://0001-Clean-up-test-runner.patch" + SRC_URI[sha256sum] = "97cba51526c829282218feb99dab1b1e6bdf8efd1c43dc9d57be093c0d69c99a" RDEPENDS:${PN} += " \
@@ -18,7 +20,9 @@ SRC_URI += " \ " RDEPENDS:${PN}-ptest += " \ - ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-doctest \ + ${PYTHON_PN}-unittest \ + ${PYTHON_PN}-unittest-automake-output \ " do_install_ptest() {
Signature · 1 line
2.34.1