diff mbox series

[meta-python,2/5] python3-glances: install config and test data for ptest

Message ID 20260912235141.2355852-2-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-python,1/5] python3-betamax: skip the live-network hook tests in ptest | expand

Commit Message

Khem Raj Sept. 12, 2026, 11:51 p.m. UTC
tests/test_core.py runs glances with ./conf/glances.conf and reads plugin
test data from ./tests-data, both relative to the ptest directory.
Neither was installed, and tests-data is not part of the pypi sdist, so
four tests failed:

  test_023_get_alert: AssertionError: 'DEFAULT' != 'OK_LOG'
  test_025_npu: IndexError: list index out of range
  test_026_mpp: AssertionError: 0 != 3 : Expected 3 MPP engines
  test_108_fs_zfs_: AssertionError: False is not true

Fetch tests-data from the v4.5.6 tag and install it, together with
conf/, next to the tests. Only tests-data/plugins is used by the tests.

With these in place tests/test_core.py passes 52/52 on qemux86-64.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../recipes-devtools/python/python3-glances_4.5.6.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-glances_4.5.6.bb b/meta-python/recipes-devtools/python/python3-glances_4.5.6.bb
index 41516e07bc..311d38cac3 100644
--- a/meta-python/recipes-devtools/python/python3-glances_4.5.6.bb
+++ b/meta-python/recipes-devtools/python/python3-glances_4.5.6.bb
@@ -11,7 +11,19 @@  inherit pypi python_setuptools_build_meta ptest-python-pytest
 
 SRC_URI += " \
 	file://run-ptest \
+	git://github.com/nicolargo/glances.git;protocol=https;branch=master;name=testsdata;subpath=tests-data;destsuffix=glances-tests-data \
 "
+# tests-data/ is used by tests/test_core.py but not shipped in the pypi sdist,
+# take it from the v4.5.6 tag
+SRCREV_testsdata = "ce2f8506289c71e48ed8bf186f2c04d8256203d5"
+
+# tests/test_core.py runs glances with ./conf/glances.conf and reads plugin
+# test data from ./tests-data, both relative to the ptest directory
+do_install_ptest:append() {
+	install -d ${D}${PTEST_PATH}/conf ${D}${PTEST_PATH}/tests-data
+	cp -rf ${S}/conf/* ${D}${PTEST_PATH}/conf/
+	cp -rf ${UNPACKDIR}/glances-tests-data/plugins ${D}${PTEST_PATH}/tests-data/
+}
 
 # psutil/jinja2/packaging are oe-core; fastapi/uvicorn/defusedxml are
 # meta-python.