[Pkg-libvirt-commits] [Git][libvirt-team/osinfo-db][debian/sid] 2 commits: Fix test_ids to work outside the source repository
Pino Toscano (@pino)
gitlab at salsa.debian.org
Sat Dec 3 06:58:47 GMT 2022
Pino Toscano pushed to branch debian/sid at Libvirt Packaging Team / osinfo-db
Commits:
f5e4be20 by Pino Toscano at 2022-12-03T07:54:04+01:00
Fix test_ids to work outside the source repository
Backport upstream commit 2d938b0e3656d7177a0bdbf7c94a9e4761eac98c to
make sure that $INTERNAL_OSINFO_DB_DATA_DIR is properly respected.
Gbp-Dch: Short
- - - - -
beeb17ea by Pino Toscano at 2022-12-03T07:56:54+01:00
testsuite autopkgtest: run test_ids again
Now it works fine after making sure that $INTERNAL_OSINFO_DB_DATA_DIR
is respected.
This reverts commit a9fc13941fb3addbec630dad465b947cb2322edd.
Gbp-Dch: Short
- - - - -
3 changed files:
- + debian/patches/series
- + debian/patches/upstream_tests-test_ids-fix-relative-path.patch
- debian/tests/testsuite
Changes:
=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+upstream_tests-test_ids-fix-relative-path.patch
=====================================
debian/patches/upstream_tests-test_ids-fix-relative-path.patch
=====================================
@@ -0,0 +1,35 @@
+From 2d938b0e3656d7177a0bdbf7c94a9e4761eac98c Mon Sep 17 00:00:00 2001
+From: Victor Toso <victortoso at redhat.com>
+Date: Thu, 1 Dec 2022 21:22:51 +0100
+Subject: [PATCH] tests/test_ids: fix relative path
+
+Running test_ids.py outside git tree is currently broken due the
+hardcoded "data" directory into relative path.
+
+This was introduced in d95a0c22 when converting test to use pathlib
+module.
+
+We should use INTERNAL_OSINFO_DB_DATA_DIR environment variable
+instead, provided by util.DataFiles.datadir.
+
+Signed-off-by: Victor Toso <victortoso at redhat.com>
+---
+ tests/test_ids.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_ids.py b/tests/test_ids.py
+index ff521d98..86150a49 100644
+--- a/tests/test_ids.py
++++ b/tests/test_ids.py
+@@ -13,7 +13,7 @@ def _test_validate_ids(xml, entity_type):
+ This check tries to mimic, in a pythonic way, the very same
+ check done by OsinfoLoader::osinfo_loader_check_id()
+ """
+- base = Path("data", entity_type)
++ base = Path(util.DataFiles.datadir, entity_type)
+ relpath = xml.path.relative_to(base)
+
+ suffix = xml.internal_id[len("http://") :]
+--
+2.35.1
+
=====================================
debian/tests/testsuite
=====================================
@@ -2,4 +2,4 @@
set -e
-INTERNAL_OSINFO_DB_DATA_DIR=/usr/share/osinfo python3 -m pytest -k 'not test_ids' tests
+INTERNAL_OSINFO_DB_DATA_DIR=/usr/share/osinfo python3 -m pytest tests
View it on GitLab: https://salsa.debian.org/libvirt-team/osinfo-db/-/compare/325d1edd914d63c7c325600c71ca221de4eae510...beeb17ea72baf94c6e2264ac76b1381335b19f4d
--
View it on GitLab: https://salsa.debian.org/libvirt-team/osinfo-db/-/compare/325d1edd914d63c7c325600c71ca221de4eae510...beeb17ea72baf94c6e2264ac76b1381335b19f4d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-commits/attachments/20221203/35e4f594/attachment-0001.htm>
More information about the Pkg-libvirt-commits
mailing list