You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: this egg does not contain the tests.. If we want to be able to test all packages in combination, the Python distributions (source dist, wheel) must include the tests. And this can be tricky because the tests directory is in the top level folder instead of in src/plone/distribution/tests.
AFAIK this top level tests directory is recommended for pytest and it can simplify test/tox setup in the package. Is that right? If so, we would want this to work.
Actually, the source distribution does contain the tests, but the wheel not. This should be solvable, but it involves diving into how to specify data files. And that page says at the bottom:
Historically, setuptools by way of easy_install would encapsulate data files from the distribution into the egg (see the old docs). As eggs are deprecated and pip-based installs fall back to the platform-specific location for installing data files, there is no supported facility to reliably retrieve these resources.
Instead, the PyPA recommends that any data files you wish to be accessible at run time be included inside the package.
My conclusion: having a top level tests directory makes it hard to run the tests of all packages combined, like we do now in buildout.coredev.
Problem 2: zope-testrunner versus pytest
Let's see if it does work when we use a checkout of plone.distribution. The bin/test file then contains this:
plone.api style: allow and encourage pytest usage outside core, but not on core
have a separate list of packages that are using pytest rather than zope.testrunner and run them both in parallel (either in Jenkins on GHA)
convert all tests to use pytest (with gocept.pytestlayer) is a bit feasible, I'm not sure if the plone.distribution style of pytest and the one from gocept.pytestlayer work hand in hand though
The lowest effort is the first one, the hardest is the last one, but maybe the middle option might be the path forward? It complicates the test setup yet-a-bit-more, but we are already splitting the test suite with Robot tests anyway, not to mention Volto that is not tested at all on any package that triggers a jenkins job run, though it has been like that since the beginning and no one seem to be complaining about it anyway 😓
For the moment the first option is fine: do not use pytest in core, meaning: Products.CMFPlone or anything below it. It is fine for core add-ons, so the packages like plone.distribution that live above Products.CMFPlone.
We can look into running pytest tests separately, the second option. That may involve installing everything with pip instead of buildout for this part. But then first we make sure that something like .venv/bin/pytest src/plone.distribution/tests/ in buildout.coredev actually works, instead of throwing errors like above.
With current buildout.coredev branch 6.1:
Problem 1: where are the tests?
In
bin/test
I see:Problem: this egg does not contain the tests.. If we want to be able to test all packages in combination, the Python distributions (source dist, wheel) must include the tests. And this can be tricky because the
tests
directory is in the top level folder instead of insrc/plone/distribution/tests
.AFAIK this top level
tests
directory is recommended forpytest
and it can simplify test/tox setup in the package. Is that right? If so, we would want this to work.Actually, the source distribution does contain the tests, but the wheel not. This should be solvable, but it involves diving into how to specify data files. And that page says at the bottom:
My conclusion: having a top level
tests
directory makes it hard to run the tests of all packages combined, like we do now inbuildout.coredev
.Problem 2: zope-testrunner versus pytest
Let's see if it does work when we use a checkout of
plone.distribution
. Thebin/test
file then contains this:This obviously does not find any tests, because they are in
.../6.1/src/plone.distribution/tests
, which is just outside the test path.Fine, let's edit the file:
Still:
Here it seems the problem is that the zope testrunner does not find any pytest tests.
Maybe installing with pip/mxdev helps, see the readme? Not immediately:
So: we have some rethinking to do on our test setup.
The text was updated successfully, but these errors were encountered: