commit:     a3939ba31fa602295d6aee83ef8e664743b598ab
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  2 15:46:23 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Wed Jul  3 13:52:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3939ba3

app-backup/borgbackup: wire up tests

pytest parameter is based on suggestion from development manual [1].

[1] 
https://github.com/borgbackup/borg/blob/aada9859ff025d15010ab71352958d4639147fd7/docs/development.rst#running-the-tests-using-the-pypi-package

Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 app-backup/borgbackup/borgbackup-1.2.8.ebuild | 29 ++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/app-backup/borgbackup/borgbackup-1.2.8.ebuild 
b/app-backup/borgbackup/borgbackup-1.2.8.ebuild
index 859d227f53c9..3026af1e55e4 100644
--- a/app-backup/borgbackup/borgbackup-1.2.8.ebuild
+++ b/app-backup/borgbackup/borgbackup-1.2.8.ebuild
@@ -16,11 +16,6 @@ LICENSE="BSD"
 SLOT="0"
 KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv x86"
 
-# "import file mismatch" when in S, "attempted relative import with no
-# known parent package" when in BUILD_DIR/install/.../borg/testsuite.
-# Needs work.
-RESTRICT="test"
-
 DEPEND="
        app-arch/lz4
        app-arch/zstd
@@ -41,10 +36,34 @@ BDEPEND="
        dev-python/cython[${PYTHON_USEDEP}]
        dev-python/pkgconfig[${PYTHON_USEDEP}]
        dev-python/setuptools-scm[${PYTHON_USEDEP}]
+       test? (
+               dev-python/python-dateutil[${PYTHON_USEDEP}]
+       )
 "
 
+EPYTEST_XDIST=1
 distutils_enable_tests pytest
 
+python_test() {
+       local EPYTEST_DESELECT=(
+               # Needs pytest-benchmark fixture
+               benchmark.py::test_
+
+               # TODO:
+               # Following tests fail because of additional warning in the 
output:
+               #   ResourceWarning: unclosed file <_io.BufferedReader name=14>
+               # which is not expected in asserts
+               
archiver.py::ArchiverTestCase::test_create_content_from_command_with_failed_command
+               
archiver.py::ArchiverTestCase::test_create_paths_from_command_with_failed_command
+               
archiver.py::RemoteArchiverTestCase::test_create_content_from_command_with_failed_command
+               
archiver.py::RemoteArchiverTestCase::test_create_paths_from_command_with_failed_command
+       )
+
+       # This disables fuse releated tests
+       local -x BORG_FUSE_IMPL="none"
+       epytest --pyargs borg.testsuite
+}
+
 src_install() {
        distutils-r1_src_install
        doman docs/man/*

Reply via email to