Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: net/synapse: fix tests
To:
Landry Breuil <landry@openbsd.org>
Cc:
ports@openbsd.org
Date:
Sun, 25 Aug 2024 09:56:33 +0200

Download raw body.

Thread
On Sun, 25 Aug 2024 09:07:11 +0200,
Landry Breuil <landry@openbsd.org> wrote:
>
> this version with a symlink for the rust lib works, and it's probably what im
> going to commit. fixing the tests requiring a throwaway synapse test instance
> is left for future work.
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/net/synapse/Makefile,v
> diff -u -r1.82 Makefile
> --- Makefile    31 Jul 2024 16:01:52 -0000      1.82
> +++ Makefile    25 Aug 2024 07:04:41 -0000
> @@ -72,10 +72,20 @@
>  TEST_DEPENDS = ${FULLPKGNAME}:${BUILD_PKGPATH} \
>                 devel/py-mock${MODPY_FLAVOR} \
>                 devel/py-parameterized${MODPY_FLAVOR} \
> +               devel/py-test-forked${MODPY_FLAVOR} \
>                 www/py-jwt${MODPY_FLAVOR}
>
>  do-configure:
>         @${MODCARGO_configure}
> +
> +MODPY_PYTEST_ARGS =    --forked
> +
> +# some tests fail, but they need a previously running synapse process, not just a database
> +# E synapse.storage.prepare_database.UpgradeDatabaseException: Uninitialised database:
> +# run the main synapse process to prepare the database schema before starting worker processes.
> +# make sure that the rust library is found
> +pre-test:
> +       ln -sf ${WRKSRC}/build/lib.openbsd-${OSREV}-${ARCH}-cpython-${MODPY_MAJORMINOR}/synapse/synapse_rust.abi3.so ${WRKSRC}/synapse/
>
>  # to generate rust modules.inc:
>  #  make modcargo-gen-crates and modcargo-gen-crates-licenses
>
> Landry
>

Well, here one more port with similar issue: archivers/py-zstandard which I
also had fixed as:

diff --git archivers/py-zstandard/Makefile archivers/py-zstandard/Makefile
index 28f9ced8b44..caea09d68b4 100644
--- archivers/py-zstandard/Makefile
+++ archivers/py-zstandard/Makefile
@@ -17,11 +17,9 @@ BUILD_DEPENDS =		devel/py-cffi${MODPY_FLAVOR}
 FLAVORS =		python3
 FLAVOR =		python3
 
-MODPY_PYTEST_ARGS =	tests/
-MODPY_TEST_DIR =	${WRKDIR}
-
 pre-test:
-	@rm -rf ${WRKDIR}/tests
-	@cp -r ${WRKSRC}/tests ${WRKDIR}/
+	find ${WRKSRC}/build/lib.openbsd-${OSREV}-${ARCH}-cpython-${MODPY_MAJORMINOR}/zstandard \
+		-name '*.so' -type f \
+		-exec ln -s {} ${WRKSRC}/zstandard \;
 
 .include <bsd.port.mk>


and I wonder, shall this hack be included into python.port.mk?

--
wbr, Kirill