diff mbox series

python3-six: Add ptest support

Message ID 20260609014110.3859502-1-Shilong.Jiao@windriver.com
State Changes Requested
Headers show
Series python3-six: Add ptest support | expand

Commit Message

Jiao, Shilong June 9, 2026, 1:41 a.m. UTC
From: Shilong Jiao <Shilong.Jiao@windriver.com>

Add ptest for python3-six using pytest to run the test_six.py
test suite included in the source package.

PASS: test_six.py::test_add_doc
PASS: test_six.py::test_import_module
PASS: test_six.py::test_integer_types
PASS: test_six.py::test_string_types
PASS: test_six.py::test_class_types
PASS: test_six.py::test_text_type
PASS: test_six.py::test_binary_type
PASS: test_six.py::test_MAXSIZE
PASS: test_six.py::test_lazy
PASS: test_six.py::test_move_items[cStringIO]
PASS: test_six.py::test_move_items[filter]
PASS: test_six.py::test_move_items[filterfalse]
PASS: test_six.py::test_move_items[input]
PASS: test_six.py::test_move_items[intern]
PASS: test_six.py::test_move_items[map]
PASS: test_six.py::test_move_items[getcwd]
PASS: test_six.py::test_move_items[getcwdb]
PASS: test_six.py::test_move_items[getoutput]
PASS: test_six.py::test_move_items[range]
PASS: test_six.py::test_move_items[reload_module]
PASS: test_six.py::test_move_items[reduce]
PASS: test_six.py::test_move_items[shlex_quote]
PASS: test_six.py::test_move_items[StringIO]
PASS: test_six.py::test_move_items[UserDict]
PASS: test_six.py::test_move_items[UserList]
PASS: test_six.py::test_move_items[UserString]
PASS: test_six.py::test_move_items[xrange]
PASS: test_six.py::test_move_items[zip]
PASS: test_six.py::test_move_items[zip_longest]
PASS: test_six.py::test_move_items[builtins]
PASS: test_six.py::test_move_items[configparser]
PASS: test_six.py::test_move_items[collections_abc]
PASS: test_six.py::test_move_items[copyreg]
PASS: test_six.py::test_move_items[dbm_gnu]
PASS: test_six.py::test_move_items[dbm_ndbm]
PASS: test_six.py::test_move_items[_dummy_thread]
PASS: test_six.py::test_move_items[http_cookiejar]
PASS: test_six.py::test_move_items[http_cookies]
PASS: test_six.py::test_move_items[html_entities]
PASS: test_six.py::test_move_items[html_parser]
PASS: test_six.py::test_move_items[http_client]
PASS: test_six.py::test_move_items[email_mime_base]
PASS: test_six.py::test_move_items[email_mime_image]
PASS: test_six.py::test_move_items[email_mime_multipart]
PASS: test_six.py::test_move_items[email_mime_nonmultipart]
PASS: test_six.py::test_move_items[email_mime_text]
PASS: test_six.py::test_move_items[BaseHTTPServer]
PASS: test_six.py::test_move_items[CGIHTTPServer]
PASS: test_six.py::test_move_items[SimpleHTTPServer]
PASS: test_six.py::test_move_items[cPickle]
PASS: test_six.py::test_move_items[queue]
PASS: test_six.py::test_move_items[reprlib]
PASS: test_six.py::test_move_items[socketserver]
PASS: test_six.py::test_move_items[_thread]
SKIP: test_six.py::test_move_items[tkinter]
SKIP: test_six.py::test_move_items[tkinter_dialog]
SKIP: test_six.py::test_move_items[tkinter_filedialog]
SKIP: test_six.py::test_move_items[tkinter_scrolledtext]
SKIP: test_six.py::test_move_items[tkinter_simpledialog]
SKIP: test_six.py::test_move_items[tkinter_tix]
SKIP: test_six.py::test_move_items[tkinter_ttk]
SKIP: test_six.py::test_move_items[tkinter_constants]
SKIP: test_six.py::test_move_items[tkinter_dnd]
SKIP: test_six.py::test_move_items[tkinter_colorchooser]
SKIP: test_six.py::test_move_items[tkinter_commondialog]
SKIP: test_six.py::test_move_items[tkinter_tkfiledialog]
SKIP: test_six.py::test_move_items[tkinter_font]
SKIP: test_six.py::test_move_items[tkinter_messagebox]
SKIP: test_six.py::test_move_items[tkinter_tksimpledialog]
PASS: test_six.py::test_move_items[urllib_parse]
PASS: test_six.py::test_move_items[urllib_error]
PASS: test_six.py::test_move_items[urllib]
PASS: test_six.py::test_move_items[urllib_robotparser]
PASS: test_six.py::test_move_items[xmlrpc_client]
PASS: test_six.py::test_move_items[xmlrpc_server]
PASS: test_six.py::test_move_items_urllib_parse[ParseResult]
PASS: test_six.py::test_move_items_urllib_parse[SplitResult]
PASS: test_six.py::test_move_items_urllib_parse[parse_qs]
PASS: test_six.py::test_move_items_urllib_parse[parse_qsl]
PASS: test_six.py::test_move_items_urllib_parse[urldefrag]
PASS: test_six.py::test_move_items_urllib_parse[urljoin]
PASS: test_six.py::test_move_items_urllib_parse[urlparse]
PASS: test_six.py::test_move_items_urllib_parse[urlsplit]
PASS: test_six.py::test_move_items_urllib_parse[urlunparse]
PASS: test_six.py::test_move_items_urllib_parse[urlunsplit]
PASS: test_six.py::test_move_items_urllib_parse[quote]
PASS: test_six.py::test_move_items_urllib_parse[quote_plus]
PASS: test_six.py::test_move_items_urllib_parse[unquote]
PASS: test_six.py::test_move_items_urllib_parse[unquote_plus]
PASS: test_six.py::test_move_items_urllib_parse[unquote_to_bytes]
PASS: test_six.py::test_move_items_urllib_parse[urlencode]
PASS: test_six.py::test_move_items_urllib_parse[splitquery]
PASS: test_six.py::test_move_items_urllib_parse[splittag]
PASS: test_six.py::test_move_items_urllib_parse[splituser]
PASS: test_six.py::test_move_items_urllib_parse[splitvalue]
PASS: test_six.py::test_move_items_urllib_parse[uses_fragment]
PASS: test_six.py::test_move_items_urllib_parse[uses_netloc]
PASS: test_six.py::test_move_items_urllib_parse[uses_params]
PASS: test_six.py::test_move_items_urllib_parse[uses_query]
PASS: test_six.py::test_move_items_urllib_parse[uses_relative]
PASS: test_six.py::test_move_items_urllib_error[URLError]
PASS: test_six.py::test_move_items_urllib_error[HTTPError]
PASS: test_six.py::test_move_items_urllib_error[ContentTooShortError]
PASS: test_six.py::test_move_items_urllib_request[urlopen]
PASS: test_six.py::test_move_items_urllib_request[install_opener]
PASS: test_six.py::test_move_items_urllib_request[build_opener]
PASS: test_six.py::test_move_items_urllib_request[pathname2url]
PASS: test_six.py::test_move_items_urllib_request[url2pathname]
PASS: test_six.py::test_move_items_urllib_request[getproxies]
PASS: test_six.py::test_move_items_urllib_request[Request]
PASS: test_six.py::test_move_items_urllib_request[OpenerDirector]
PASS: test_six.py::test_move_items_urllib_request[HTTPDefaultErrorHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPRedirectHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPCookieProcessor]
PASS: test_six.py::test_move_items_urllib_request[ProxyHandler]
PASS: test_six.py::test_move_items_urllib_request[BaseHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPPasswordMgr]
PASS: test_six.py::test_move_items_urllib_request[HTTPPasswordMgrWithDefaultRealm]
PASS: test_six.py::test_move_items_urllib_request[AbstractBasicAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPBasicAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[ProxyBasicAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[AbstractDigestAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPDigestAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[ProxyDigestAuthHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPSHandler]
PASS: test_six.py::test_move_items_urllib_request[FileHandler]
PASS: test_six.py::test_move_items_urllib_request[FTPHandler]
PASS: test_six.py::test_move_items_urllib_request[CacheFTPHandler]
PASS: test_six.py::test_move_items_urllib_request[UnknownHandler]
PASS: test_six.py::test_move_items_urllib_request[HTTPErrorProcessor]
PASS: test_six.py::test_move_items_urllib_request[urlretrieve]
PASS: test_six.py::test_move_items_urllib_request[urlcleanup]
PASS: test_six.py::test_move_items_urllib_request[proxy_bypass]
PASS: test_six.py::test_move_items_urllib_request[parse_http_list]
PASS: test_six.py::test_move_items_urllib_request[parse_keqv_list]
PASS: test_six.py::test_move_items_urllib_response[addbase]
PASS: test_six.py::test_move_items_urllib_response[addclosehook]
PASS: test_six.py::test_move_items_urllib_response[addinfo]
PASS: test_six.py::test_move_items_urllib_response[addinfourl]
PASS: test_six.py::test_move_items_urllib_robotparser[RobotFileParser]
PASS: test_six.py::test_import_moves_error_1
PASS: test_six.py::test_import_moves_error_2
PASS: test_six.py::test_import_moves_error_3
PASS: test_six.py::test_from_imports
PASS: test_six.py::test_filter
PASS: test_six.py::test_filter_false
PASS: test_six.py::test_map
PASS: test_six.py::test_getoutput
PASS: test_six.py::test_zip
PASS: test_six.py::test_zip_longest
PASS: test_six.py::TestCustomizedMoves::test_moved_attribute
PASS: test_six.py::TestCustomizedMoves::test_moved_module
PASS: test_six.py::TestCustomizedMoves::test_custom_move_module
PASS: test_six.py::TestCustomizedMoves::test_custom_move_attribute
PASS: test_six.py::TestCustomizedMoves::test_empty_remove
PASS: test_six.py::test_get_unbound_function
PASS: test_six.py::test_get_method_self
PASS: test_six.py::test_get_method_function
PASS: test_six.py::test_get_function_closure
PASS: test_six.py::test_get_function_code
PASS: test_six.py::test_get_function_defaults
PASS: test_six.py::test_get_function_globals
PASS: test_six.py::test_dictionary_iterators
PASS: test_six.py::test_dictionary_views
PASS: test_six.py::test_advance_iterator
PASS: test_six.py::test_iterator
PASS: test_six.py::test_callable
PASS: test_six.py::test_create_bound_method
PASS: test_six.py::test_create_unbound_method
PASS: test_six.py::test_b
PASS: test_six.py::test_u
PASS: test_six.py::test_u_escapes
PASS: test_six.py::test_unichr
PASS: test_six.py::test_int2byte
PASS: test_six.py::test_byte2int
PASS: test_six.py::test_bytesindex
PASS: test_six.py::test_bytesiter
PASS: test_six.py::test_StringIO
PASS: test_six.py::test_BytesIO
PASS: test_six.py::test_exec_
PASS: test_six.py::test_reraise
PASS: test_six.py::test_raise_from
PASS: test_six.py::test_print_
PASS: test_six.py::test_print_exceptions
PASS: test_six.py::test_with_metaclass
PASS: test_six.py::test_with_metaclass_typing
PASS: test_six.py::test_with_metaclass_pep_560
PASS: test_six.py::test_with_metaclass_prepare
PASS: test_six.py::test_wraps
PASS: test_six.py::test_wraps_raises_on_missing_updated_field_on_wrapper
PASS: test_six.py::test_add_metaclass
PASS: test_six.py::test_add_metaclass_nested
PASS: test_six.py::test_assertCountEqual
PASS: test_six.py::test_assertRegex
PASS: test_six.py::test_assertNotRegex
PASS: test_six.py::test_assertRaisesRegex
PASS: test_six.py::test_python_2_unicode_compatible

DURATION: 2
TOTAL: 1 FAIL: 0

Signed-off-by: Shilong Jiao <Shilong.Jiao@windriver.com>
---
 meta/conf/distro/include/ptest-packagelists.inc   |  1 +
 .../recipes-devtools/python/python3-six/run-ptest |  8 ++++++++
 .../recipes-devtools/python/python3-six_1.17.0.bb | 15 ++++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100755 meta/recipes-devtools/python/python3-six/run-ptest

Comments

Mathieu Dubois-Briand June 9, 2026, 8:55 a.m. UTC | #1
On Tue Jun 9, 2026 at 3:41 AM CEST, Shilong via lists.openembedded.org Jiao wrote:
> From: Shilong Jiao <Shilong.Jiao@windriver.com>
>
> Add ptest for python3-six using pytest to run the test_six.py
> test suite included in the source package.
>

Hi,

Thanks for your patch.

It looks like some tests are failing on the autobuilder:

Failed ptests:
{'python3-six': ['test_six.py::test_lazy',
                 'test_six.py::test_move_items[html_entities]',
                 'test_six.py::test_move_items[html_parser]',
                 'test_six.py::test_move_items[BaseHTTPServer]',
                 'test_six.py::test_move_items[CGIHTTPServer]',
                 'test_six.py::test_move_items[SimpleHTTPServer]',
                 'test_six.py::test_move_items[xmlrpc_client]',
                 'test_six.py::test_move_items[xmlrpc_server]']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/3794
https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/522
https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/505

Can you have a look at the issue?

Thanks,
Mathieu
Jiao, Shilong June 9, 2026, 9:04 a.m. UTC | #2
Hi,

Thanks for the feedback. I'll investigate the failing tests and work on fixing them.

Looking at the failed tests, they seem to be related to:
- test_lazy: Module lazy loading functionality
- test_move_items: Python 2 to 3 module renaming/moving tests (html_entities, html_parser, HTTP servers, xmlrpc modules)

I'll analyze the test failures from the autobuilder logs and send an updated patch soon.

Best regards,
Shilong Jiao

Best regards,
shilong
Tel:84778559
cellphone:15910943969
Jiao, Shilong June 9, 2026, 10:09 a.m. UTC | #3
Hi,

Quick update on my investigation:

I've tested these failing cases locally in my build environment, and
interestingly all 8 tests pass:
- test_lazy: PASS
- test_move_items[html_entities]: PASS
- test_move_items[html_parser]: PASS
- test_move_items[BaseHTTPServer]: PASS
- test_move_items[CGIHTTPServer]: PASS
- test_move_items[SimpleHTTPServer]: PASS
- test_move_items[xmlrpc_client]: PASS
- test_move_items[xmlrpc_server]: PASS

This suggests the failures might be specific to the autobuilder environment
or related to test execution order. The test_lazy failure in particular
looks like it could be caused by html.parser already being imported when
the test runs.

Could you help me access the detailed error messages from the autobuilder
logs? This would help me understand the actual failure mode and create an
appropriate fix.

Thanks,
Shilong Jiao
Mathieu Dubois-Briand June 10, 2026, 12:55 p.m. UTC | #4
On Tue Jun 9, 2026 at 12:09 PM CEST, Shilong via lists.openembedded.org Jiao wrote:
> Hi,
>
> Quick update on my investigation:
>
> I've tested these failing cases locally in my build environment, and
> interestingly all 8 tests pass:
> - test_lazy: PASS
> - test_move_items[html_entities]: PASS
> - test_move_items[html_parser]: PASS
> - test_move_items[BaseHTTPServer]: PASS
> - test_move_items[CGIHTTPServer]: PASS
> - test_move_items[SimpleHTTPServer]: PASS
> - test_move_items[xmlrpc_client]: PASS
> - test_move_items[xmlrpc_server]: PASS
>
> This suggests the failures might be specific to the autobuilder environment
> or related to test execution order. The test_lazy failure in particular
> looks like it could be caused by html.parser already being imported when
> the test runs.
>
> Could you help me access the detailed error messages from the autobuilder
> logs? This would help me understand the actual failure mode and create an
> appropriate fix.
>
> Thanks,
> Shilong Jiao
> ________________________________

Hi,

The autobuilder configuration is described in the "Write config" step of
the build.

I did reproduce this issue locally with following layers:
BBLAYERS ?= " \
  .../openembedded-core/meta \
  .../meta-yocto/meta-poky \
  .../meta-yocto/meta-yocto-bsp \
  .../openembedded-core/meta-selftest \
  "

And following lines in my local.conf:
SDKMACHINE = "x86_64"
PACKAGE_CLASSES = "package_rpm package_deb package_ipk"
INHERIT += 'image-buildinfo'
IMAGE_BUILDINFO_VARS:append = ' IMAGE_BASENAME IMAGE_NAME'
TEST_SUITES = 'ping ssh ptest'
SANITY_TESTED_DISTROS = ''
OEQA_TESTDISPLAY = ':1'
OE_FRAGMENTS += 'core/yocto-autobuilder/autobuilder core/yocto-autobuilder/autobuilder-resource-constraints'
EXTRA_IMAGE_FEATURES ?= 'allow-empty-password empty-root-password allow-root-login'
OE_FRAGMENTS += 'machine/qemux86-64 distro/poky'

Thanks,
Mathieu
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 0eaa09eb33..a340418211 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -88,6 +88,7 @@  PTESTS_FAST = "\
     python3-pytz \
     python3-pyyaml \
     python3-rpds-py \
+    python3-six \
     python3-trove-classifiers \
     python3-vcs-versioning \
     python3-uritools \
diff --git a/meta/recipes-devtools/python/python3-six/run-ptest b/meta/recipes-devtools/python/python3-six/run-ptest
new file mode 100755
index 0000000000..285c442b3c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-six/run-ptest
@@ -0,0 +1,8 @@ 
+#!/bin/bash
+
+PTEST_DIR=$(dirname $(readlink -f $0))
+python3 -m pytest -v --tb=short $PTEST_DIR/test_six.py 2>&1 | \
+    sed -n -e 's/^\(.*::[^ ]*\) PASSED.*/PASS: \1/p' \
+           -e 's/^\(.*::[^ ]*\) FAILED.*/FAIL: \1/p' \
+           -e 's/^\(.*::[^ ]*\) SKIPPED.*/SKIP: \1/p' \
+           -e 's/^\(.*::[^ ]*\) ERROR.*/FAIL: \1/p'
diff --git a/meta/recipes-devtools/python/python3-six_1.17.0.bb b/meta/recipes-devtools/python/python3-six_1.17.0.bb
index 693f1818d3..213b3dc593 100644
--- a/meta/recipes-devtools/python/python3-six_1.17.0.bb
+++ b/meta/recipes-devtools/python/python3-six_1.17.0.bb
@@ -1,4 +1,17 @@ 
-inherit setuptools3
+inherit setuptools3 ptest
 require python-six.inc
 
 SRC_URI[sha256sum] = "ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"
+
+SRC_URI += "file://run-ptest"
+
+RDEPENDS:${PN}-ptest += " \
+    bash \
+    python3-pytest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}
+    install -m 0644 ${S}/test_six.py ${D}${PTEST_PATH}/
+}