Download raw body.
net/synapse: fix tests
Le Thu, Aug 22, 2024 at 09:40:23AM +0200, Landry Breuil a écrit :
> Le Wed, Aug 21, 2024 at 06:11:32PM +0200, Kirill A. Korinsky a écrit :
> > On Wed, 21 Aug 2024 17:16:11 +0200,
> > Landry Breuil <landry@openbsd.org> wrote:
> > >
> > > Le Wed, Aug 21, 2024 at 05:00:21PM +0200, Landry Breuil a écrit :
> > > > Le Wed, Aug 21, 2024 at 03:49:45PM +0200, Kirill A. Korinsky a écrit :
> > > > > ports@,
> > > > >
> > > > > Here a ping from another diff from my
> > > >
> > > > can you explain the dance about dropping/copying tests in pre-test ?
> > > > why was that needed ? isn't doing MODPY_PYTEST_ARGS = --forked enough ?
> > >
> > > now that i've tested, this fails with a rather strange error (strange as
> > > in "i dont understand why moving tests/ around helps") on all test files:
> > >
> >
> > and I confirm that this is the problem I am overlooking by moving tests.
> >
> > I had discovered this problem at archivers/py-zstandard which I made for
> > mitmproxy, but it was more than two months ago I and can not easily recall
> > why it's help and how I discovered this hack.
> >
> > Probably it doesn't have the correct PYTHONPATH and I can't figure out how
> > to set it correctly in case of cffi on this port.
>
> i've tried playing with MODPY_TEST_LIBDIR to give it the right path to
> the synapse_rust.abi3.so file, but everything i've tried so far fails.
here's something that 'works' standalone:
[09:58]
c64:/usr/obj/ports/synapse-1.112.0/synapse-1.112.0/build/lib.openbsd-7.6-amd64-cpython-311/ $python3
>>> import sys
>>> sys.path.append('/usr/obj/ports/synapse-1.112.0/synapse-1.112.0/')
>>> import tests.api.test_auth
>>>
but integrated in the portstree this way:
MODPY_PYTEST_ARGS = --forked ${WRKSRC}/tests
MODPY_TEST_DIR = ${WRKSRC}/build/lib.openbsd-${OSREV}-${ARCH}-cpython-${MODPY_MAJORMINOR}/
MODPY_TEST_LIBDIR = ${WRKSRC}
trying with make -n do-test, this is the command run (env stripped for
readability) and taht fails:
cd /usr/obj/ports/synapse-1.112.0/synapse-1.112.0/build/lib.openbsd-7.6-amd64-cpython-311/
&& env PYTHONPATH=/usr/obj/ports/synapse-1.112.0/synapse-1.112.0:src:lib
/usr/local/bin/python3.11 -m pytest --forked /usr/obj/ports/synapse-1.112.0/synapse-1.112.0/tests
it feels we're getting close.. but not yet.
Landry
net/synapse: fix tests